Home >Backend Development >PHP Tutorial >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
Is there an index?
Whether the query statement uses an index;
What is the distribution of data records and index fields;
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.