Performance analysis for MongoDB and MySQL

Source: Internet
Author: User

Server configuration:

Cpu:1 Core Memory: 2048 MB (I/O optimized) network bandwidth: 1Mcentos 7.0MongoDB 3.2
MySQL 5.6 Server table Data volume 1,184,545 MongoDB data is imported by MySQL, ensure the data consistent experiment prepared to execute the statement as: MySQL:

SELECT *
From sharelooks_30d m
WHERE m.lng>_lng1 and M.lng<_lng2 and M.lat>_lat2 and M.LAT<_LAT1
ORDER by ID DESC LIMIT 30;

Mongodb:

Db.sharelooks_30d.find (
{"LNG":
{"$GT": lng1, "$lt": Lng2},
"Lat":
{"$GT": Lat2, "$lt": LAT1}
}
). Sort ({"ID": -1}). Limit (30)

First time: MongoDB not added index: 1.5S

Mysql: Added index: 1.23S

After MongoDB adds an index:

Execution time is 0.2 seconds

To change the input parameters:

My is cut: 5.412S mongodb:1.1s

So probably the difference between the query 5-6 times

Performance analysis for MongoDB and MySQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.