Home > Database > Mysql Tutorial > Under what circumstances should sql optimization be performed in MySQL?

Under what circumstances should sql optimization be performed in MySQL?

王林
Release: 2023-04-17 19:49:01
forward
853 people have browsed it

Introduction to sql optimization

1. Under what circumstances should sql optimization be performed?

Low performance, too long execution time, too long waiting time, connection query, and index failure .

2. SQL statement execution process

(1) Writing process

select distinct ... from ... join ... on ... where ... group by ... having ... order by ... limit ...
Copy after login

(2) Parsing process

from ... on ... join ... where ... group by ... having ... select distinct ... order by ... limit ...
Copy after login

3. SQL optimization is to optimize the index

The index is equivalent to the table of contents of the book.

The data structure of the index is a B-tree.

The above is the detailed content of Under what circumstances should sql optimization be performed in MySQL?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
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