Data query performance test comparison between MySQL and MongoDB
After testing the batch insert yesterday, let’s test the read today. Due to many test items, I use my local computer to test: sempron2300+, 2G memory, xp 32-bit. For this test, I will take 1, 10, 20, 50, 100, 1000, 5000, 10000, 100000, 200000 as reference values Test condition 1: select id,a1,a2 from a order by id desc limit x Test condition 2: select id,a1,a2 from a where id>100000 order by id desc limit 1 Test condition 3: select id,a1,a2 from a where id>100000 order by id desc limit 200000, x select id,a1,a2 from a where id=’100000’… Test condition 6: select id,a1,a2 from a where id>’100000′ and id<'100050' order by id desc Based on the above data: mysql reads data faster than mongodb under the restriction of sorting query conditions Under the condition of reading a large result set, mysql reads data faster than mongodb; but when reading a small amount of data, mysql reads data slower than mongodb If you specify where, mysql reads data a little faster than mongodb, but as more and more where, mysql reads data faster than mongodb the the