Home  >  Article  >  Database  >  What does mysql's Explain command do?

What does mysql's Explain command do?

WBOY
WBOYforward
2023-05-31 12:33:301264browse

Concept

1. Explain is used to analyze the SELECT query statement. Developers can optimize the query statement by analyzing the Explain results.

Function

2. Through the explain command, we can learn how the SQL is executed, and then parsing the explain results can help us use better indexes. Finally optimize it!

Through the explain command we can know the following information: table reading order, type of data reading operation, which indexes can be used, which indexes are actually used, references between tables, how many are in each table Information such as rows queried by the optimizer.

Example

explain select * from table_user ;

The above is the detailed content of What does mysql's Explain command do?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete