mysql procedure-What technology is used to query more than one million data in MySQL?

WBOY
Release: 2016-08-25 10:19:36
Original
1240 people have browsed it

mysql procedure please mysql expert phpmysql Chinese linux

What technology should be used to query more than one million data in MySQL to improve the search speed? And memory consumption will be reduced?

Reply content:

The easiest way to optimize queries is indexing.
If you want to do higher-level optimization, you need to analyze the specific problems in detail. Will the data in your table be used by others? Can it be split into multiple tables?
There are also data that may not be queried at ordinary times, which can be stored in a history table.
There are also business restrictions, such as checking data within three months or six months. These methods are all ways to optimize queries.
The next step is to optimize the SQL statement. You can use the query plan to analyze the SQL statement and find out where it consumes time and memory.
When all the above methods have been tried and fail, you may need to expand the hardware device to speed up the process.
In general, there are many ways to optimize query speed, depending on your problem.

Create corresponding indexes based on your query conditions. It can greatly improve the query speed

Explain it first, print out the execution plan, and optimize it according to the actual situation.

Reference from:
MySQL optimization tutorial http://www.data.5helpyou.com/

Establish appropriate indexes, reasonable table structures (intra-table, between tables) and suitable query SQL.
I began to think about how to write an index. After all, query speed index is the most commonly used, but if the amount of data is huge, some existing technologies can also be used

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!