MySQL explain explain various information display function

1, id: serial number MySQL Query Optimizer selected query execution plan.
2, select_type: query type is used, there are these types of the following types of queries.
  DEPENDENT SUBQUERY: a first sub-queries select inner layer, the result set depends on the outer query.
  DEPENDENT UNION: subquery union, and the union of the back starting from the second select all select, also depends on the outer query result set.
  PRIMARY: subquery outermost query, pay attention to is not the primary key query.
  SIMPLE: In addition to the other sub-query query or union outside.
  SUBQUERY: a first sub-queries select inner query, the results do not depend on the outer query result set.
  UNCACHETABLE SUBQUERY: the result set can not be cached sub-queries.
  UNION: union all select a second statement later began to select, first select for the primary.
  UNION RESULT: The combined results of the union.
3, table: This step displays the name of the database being accessed in the table.
4, type: tell our team table access method used, mainly includes the following types.
  all: full table scan.
  const: Constant reading, at most, only one record matching, because it is constant, in fact, only need to read once.
  eq_ref: it will only result there is a match, usually accessed via a primary key or unique key index.
  fulltext: full-text index search.
  index: full index scan.
  index_merge: query using both (or more) index, and then combine the results of the index, and then read the data table.
  index_subquery: subquery returns result field is a combination index (or index combination), but not a primary key or a unique index.
  rang: an index range scan.
  ref: join statement chant drive table lookup index references.
  ref_or_null: ref only difference is that in addition to using query index referenced by the query to add a null value.
  system: The system table in which only one row of data.
  unique_subquery: subquery returns the result field is a primary key or a unique combination of constraint.
5, Possible_keys: This query can use the index. If there is no index can be used, is displayed as null, this element is very important to optimize the adjustment of the index.
6, key: MySQL Query Optimizer to use the index to select from possible_keys in.
7, key_len: the selected length of the key index using the index.
8, ref: list is by constant (const), or a field to a table (if it is jion) came up (by key) is.
9, rows: MySQL Query Optimizer statistics collected by the system, estimated the number of records in the result set.
10, extra: Additional details every step of the realization of the inquiry, the principal will have the following
11, distinct: Find distinct value, when the result of the first match of mysql is found, the value of the query will stop, later converted to other values query.
12, full scan on null key: an optimal way subquery, mainly in the face can not access the null value by using the index.
13, impossible where noticed after reading const tables: MySQL Query Optimizer statistical information collected result is judged not exist.
14, no tables: query statement from dual use or does not contain any clause from.
15, not exists: in some left connection, MySQL Query Optimizer optimized by changing the method of using the composition of the original Query may be partially reduce data access times.
16, range checked for each record ( index map: N): MySql by describing the manual, as MySQL Query Optimizer when the index is not found good can be used, if it is found in front of the table column values are known, the index portion may be used. Each row of the table of combinations of the foregoing, MySql range can be used to check whether or indexed access method index_merge row.
17, select tables optimized away: when we use certain aggregate functions to access a field index existed at the time, MySQL Query Optimizer will first locate the data needed to complete the inquiry line directly through the index, of course, that in Query You can not have group by operation.
18, using filesort: When Query contains order by operation, and can not use the index to complete the sort operations, MySQL Query Optimizer have to select the appropriate sorting algorithm.
19, using index: all the required data can be obtained only in the index, the data does not need to get into the table.
20, using index for group-by : accessing and using index data as an index to read only the required data, when the Query group by the use or distinct clause, also if the packet index field, this information is displayed .
21, using temporary: When MySQL must use temporary tables in some operations, will appear in this extra information. The main common in the group by and order by and other operations.
22, using where: If the table does not read all the data, or not just needs to get all the data through the index, using where information appears.
23, using where with pushed condition: It is a message just NDBCluster storage engine to appear, but also need to optimize the functionality available through the open condition pushdown can be used. Control parameters engine_condition_pushdown

 

Guess you like

Origin www.cnblogs.com/allenhu320/p/11387124.html