Is there a large amount of data in 1.37 million rows? it is very slow to query this table. I don't know how to optimize it?

Source: Internet
Author: User
SegmentFault (www. sf. gg) is a leading developer technology community in China. We hope to provide programmers with a pure and high-quality technology exchange platform to learn, communicate and grow with developers and create an era for developers!

Reply content:

1 million of the data volume is small, and the optimization is generally to add an index.

  1. There is no index;

  2. Does the query statement use indexes;

  3. What is the distribution of data records and index fields;

  4. What types of data fields are there;

Add indexes and optimize SQL statements,

Select count (primary key or unique index)

Mysql 10 millions or 20 millions data is also supported, depending on the needs

1.37 million is nothing at all.
1. pay attention to index hits of SQL statements during queries.
2. check the MYSQL cache configuration.
3. use primary key query whenever possible.
4. vertical cutting of tables can be performed to reduce data redundancy based on business needs.

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.