MySQL procedure mysql master phpmysql Chinese Linux
MySQL more than 1 million data query to use what technology can make the search speed improved? And the memory consumption will be reduced?
Reply content:
The simplest way to optimize queries is to index.
If you want to do a higher level of optimization will be specific problems specific analysis, others your table data is not to use, can split into more than one table?
There are also data that may not be queried can be saved by a history table.
The other is the business restrictions, such as the three months or six months to check the data. These methods are all methods of optimizing queries.
Further down is the optimization of SQL statements, which can be used to analyze SQL statements using query plans to find out where memory is time consuming.
When all the above methods have been tried, it is estimated that you need to expand the hardware to speed up the device.
In general there are many ways to optimize the query speed, depends on your problem.
Establish the corresponding index based on the criteria you are querying. Can improve query speed very well
First explain, print out the execution plan, according to the actual situation to optimize.
Reference from:
MySQL Optimization tutorial http://www.data.5helpyou.com/
Establish appropriate indexes, reasonable table structure (in-table, inter-table), and appropriate query SQL.
Start to think how to write an index, after all, query speed index is the most common, but if the volume of data is large, using some of the technology can also