MySQL 执行计划中代价估算的输出信息


来源: http://dev.mysql.com/worklog/task/?id=6510
EXPLAIN JSON should print cost for following:
*) "query_cost" - total cost of a query block, no matter top query or a subquery.
*) "sort_cost" - cost of the first sorting operation (GROUP BY or ORDER BY) where 
and if filesort is used. Cost for second sorting operation isn't printed as 
optimizer doesn't calculate it.
*) "read_cost" - cost of reading for each table used in the query block.
*) "eval_cost" - cost of condition evaluation for each table in the query block.
*) "prefix_cost" - cost of executing prefix join in the query block.  

/* *) "data_read_per_join" - estimated amount of data from the table processed during single query block execution. *) "rows_produced_per_join"/"rows_examined_per_scan" estimated number of records from the table (per each table from the query block) produced/examined per single query block execution. *) "used_columns" - list of columns of the table (per each table in the query block) used for either read or write in the query.

 另外,还有解释如下:
1) "query_cost" total [sub]query cost per one execution. Wrapped in the "cost_info" node, child of the "query_block" node. For the top-level select should be equal to the 'last_query_cost' status variable. 2) "sort_cost" cost of filesort, independently of algorithm. Wrapped in the "cost_info" node, child of the "ordering_operation" node. 3) "read_cost" cost of retrieving data from table, i.e access method cost. 4) "eval_cost" cost of .
 
 

你可能感兴趣的:(数据库)