There is a tens of millions of-record table on MySQL 5.0.x, which now reads about 1 billion of the records. Common methods, followed by loops:
1
The code is as follows
Copy Code
SELECT * FROM mytable where index_col =
In mysql, limit can achieve fast paging. However, if the data reaches several millions, our limit must be optimized to effectively implement paging. Otherwise, your server may be stuck.This is a problem when a table has millions of data records!For
When a table data has millions of of data, pagination is a problemsuch as SELECT * FROM table limit 0,10 This is no problem when the limit 200000,10 data reading is very slow, you can follow the method to solve
A recent web site's server reviews
In MySQL limit can achieve fast paging, but if the data to millions of when our limit must be optimized to effectively achieve a reasonable paging, otherwise may be stuck to your server oh.
When a table data has millions of of the data is a problem!
Paging usage and Performance Optimization of mysql limit
Mysql tutorial limit performance problems
A table with tens of millions of records on mysql 5.0.x needs to read about tens of thousands of records.
Common Methods:Select * from mytable where
MySQL Tutorial limit performance issues
There is a tens of millions of-record table on MySQL 5.0.x, now read out a few 1 billion records
Common methods, followed by loops:SELECT * FROM mytable where index_col = xxx limit offset, limit;
Experience:
MySQL page is relatively simple, only need limit offset,length can get data, but when the offset and length is larger, MySQL significantly degraded performance
1. Sub-Query optimization method
The first piece of data, then the ID that is greater
I. User table information
Ii. Conclusion
Use the query statement: Select count (1) from user; Use the explain statement to check whether the statement is indexed. the following result shows the query time of the statement.
Data Volume query
How to limit the size of returned result sets in Oracle and MySQLIn ORACLE:
How can I use rownum to limit the number of rows returned by a query?Software environment:1. Windows NT4.0 + Oracle 8.0.42. Oracle installation path: C:/orant
Description:1.
The difference between mysqlSELECTFOUND_ROWS () and COUNT (*) is that both FOUND_ROWS () and COUNT (*) in mysql can collect statistics records. if both are the same, why are there two such functions, the following describes the usage differences
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.