sql: SQL optimization knowledge point records (11)

(1) Use Show Profile for sql analysis

A new optimized way to show Profile

 

Run some query sql:

Look at the sql we have executed

 

Display the complete process of sql query statement cycle: 

When the execution process appears in the following four, there will be problems that lead to slow efficiency 

8 This sql creates a temporary table that causes sql to slow down

(2) Global query log

Show Profile: Records some sql that we need to open in the background, the global query log, and sometimes helps us to adjust sql, but it is only used in the test environment and is not allowed to be used in the production environment

Use this table to help us collect what kind of sql happened in our time period, and then help us locate and collapse

(3) Overview of database lock theory

 

Locks have pros and cons

おすすめ

転載: blog.csdn.net/dengfengling999/article/details/132679610