1024programmer Mongodb Data query performance test comparison between MySQL and MongoDB

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

Mysql and mongodb read data efficiency test - Maruko - Maruko

Mysql and mongodb read data efficiency test - Maruko - Maruko

Test condition 2:

select id,a1,a2 from a where id>100000 order by id desc limit
1

Mysql and mongodb read data efficiency test - Maruko - Maruko
Mysql and mongodb read data efficiency test - Maruko - Maruko
Test condition 3:

select id,a1,a2 from a where id>100000 order by id desc limit
200000, x

Mysql and mongodb read data efficiency test - Maruko - Maruko
Mysql and mongodb read data efficiency test - Maruko - Maruko
Mysql and mongodb read data efficiency test - Maruko - Maruko
Mysql and mongodb read data efficiency test - Maruko - Maruko
Mysql and mongodb read data efficiency test - Maruko - Maruko
Mysql and mongodb read data efficiency test - Maruko - Maruko
Mysql and mongodb read data efficiency test - Maruko - Maruko
Mysql and mongodb read data efficiency test - Maruko - Maruko

select id,a1,a2 from a where id=’100000’…

Mysql and mongodb read data efficiency test - Maruko - Maruko
Mysql and mongodb read data efficiency test - Maruko - Maruko
Mysql and mongodb read data efficiency test - Maruko - Maruko

Test condition 6:

select id,a1,a2 from a where id>’100000′ and id<'100050'
order by id desc

Mysql and mongodb read data efficiency test - Maruko - Maruko

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

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/data-query-performance-test-comparison-between-mysql-and-mongodb/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索