Home  >  Article  >  Backend Development  >  Is 1.37 million rows of data a large amount? Querying this table is very slow now. I don’t know how to optimize it?

Is 1.37 million rows of data a large amount? Querying this table is very slow now. I don’t know how to optimize it?

WBOY
WBOYOriginal
2016-09-14 09:41:261122browse

Is 1.37 million rows of data a large amount? Querying this table is very slow now. I don’t know how to optimize it?

Reply content:

Is 1.37 million rows of data a large amount? Querying this table is very slow now. I don’t know how to optimize it?

1 million data is not a large amount, optimization usually involves adding indexes

  1. Is there an index?

  2. Whether the query statement uses an index;

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

  4. What types of data fields are there;

Add index and optimize sql statement,

select count (primary key or unique index)

mysql can support data of 10 to 20 million, it depends on the demand

1.37 million is nothing at all.
1. When querying, pay attention to the index hit status of the SQL statement.
2. Take a look at the cache configuration of MYSQL.
3. Try to use primary key queries.
4. Tables can be cut vertically according to business needs to reduce data redundancy.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn