Comparison of query performance test between MongoDB and MySQL
Recently, I want to use Mongodb to do some storage layer things. At present, it is mainly used in id query or ids query (such as mysql‘s in Inquire). Whether the new solution can be launched depends on performance. Now compare mongodb with mysql. Environment: the same machine, equipped with mongodb 1.4, mysql; memory 4g; both databases only have unique search of id; data volume 120w About 5w queries. Do an id or ids query on them. the mongodb mysql total time avg time/per query total time avg time/per query 1 id/per query 11954ms, 00:11,954 0ms, 00,0 78613ms, 00:1:18,613 1ms, 00,1 10 id/per query 35885ms, 00:35,885 0ms, 00,0 107274ms, 00:1:47,274 2ms, 00,2 20 id/per query 63714ms, 00:1:3,714 1ms, 00,1 186398ms, 00:3:6,398 3ms, 00,3 5 threads, 20 id/per query – 5ms, 00,5 – 11ms, 00,11 10 thread, 20 id/per query – 10ms, 00, 10 – 22ms, 00, 22 the From the table above: For each query of an id, mongodb is 7 times faster than mysql under basically the same conditions. For queries with multiple ids (10/20) per query, mongodb is 2 times faster than mysql. Check multiple ids under multi-threading, mongodb is 1 times faster than mysql. From the above…