explain the meaning of each attribute

 

 
    Each attribute meanings:
    id: Query serial number
    select_type: the type of query, the main query is the difference between ordinary and union queries, complex queries like subqueries
  • SIMPLE: the query does not contain subqueries or UNION
  • If the query contains any complex sub-section, the outermost query were marked: PRIMARY
  • Included in the SELECT list or WHERE subquery, the subquery is marked: SUBQUERY
   table: output line table referenced
    type: type of access
    From left to right, from the poor to good performance
  1. ALL: full table scan
  2. index: scanning all indexes tree
  3. range: scanning part index, index range scan, index scan begins at a certain point, matching range of return lines, common in between, <,> and other inquiries
  4. ref: Use non-unique index or unique index prefix lookup
(Const and the difference eq_ref :)
  1. eq_ref: unique index scan, for each index key, only one record in the table match. Common in the primary key or unique index scan
  2. const, system: single table has at most one matching row, the query is very fast, such as a query based on the main key or unique index. const type system is a special case, in the case where only one row of table queries, system use.
  3. NULL: do not access the table or index, you can get immediate results, such as select 1 from test where 1
    possible_keys: indicates the index may be used in the query. If it is empty, no relevant index. This time to improve performance, by examining the WHERE clause to see if some reference fields, or check the field is not fit index
    key: display the index that MySQL actually decided to use. If no index is selected, is NULL
    key_len: Use the length of the index field
    Note: The maximum possible length values ​​of the index fields displayed key_len, not actual length, i.e., is calculated on the basis key_len table definition, are not retrieved by the table.
    ref: shows which field or constant is used with key
    rows: mysql This number indicates how much data to traverse to find shows based on MySQL table statistics and index selection, the estimated number of lines needed to find records to be read in the innodb may be inaccurate
    Extra: implementation of illustration and description. Unsuitable for display but additional information is very important in the other columns.
    1. Using index: expressed using the index, if only Using index, shows that he can not find any data table, only the index table to complete the query, this is called a covering index.
    2. Using where: represents a conditional query, if you do not read all the data in the table, or you can not just get all the required data through the index, Using where it will appear.

Guess you like

Origin www.cnblogs.com/kevinleerunqing/p/12034317.html