QUERY: explain extended select id from states where country_id < 100 union (select id from countries where id > 10)
TRACE: {
"steps": [
{
"join_preparation": {
"select#": 1,
"steps": [
{
"expanded_query": "/* select#1 */ select `states`.`id` AS `id` from `states` where (`states`.`country_id` < 100)"
}
]
}
},
{
"join_preparation": {
"select#": 2,
"steps": [
{
"expanded_query": "/* select#2 */ select `countries`.`id` AS `id` from `countries` where (`countries`.`id` > 10)"
}
]
}
},
{
"creating_tmp_table": {
"tmp_table_info": {
"table": "intermediate_tmp_table",
"row_length": 5,
"key_length": 4,
"unique_constraint": false,
"location": "memory (heap)",
"row_limit_estimate": 3355443
}
}
},
{
"join_optimization": {
"select#": 1,
"steps": [
{
"condition_processing": {
"condition": "WHERE",
"original_condition": "(`states`.`country_id` < 100)",
"steps": [
{
"transformation": "equality_propagation",
"resulting_condition": "(`states`.`country_id` < 100)"
},
{
"transformation": "constant_propagation",
"resulting_condition": "(`states`.`country_id` < 100)"
},
{
"transformation": "trivial_condition_removal",
"resulting_condition": "(`states`.`country_id` < 100)"
}
]
}
},
{
"table_dependencies": [
{
"table": "`states`",
"row_may_be_null": false,
"map_bit": 0,
"depends_on_map_bits": [
]
}
]
},
{
"ref_optimizer_key_uses": [
]
},
{
"rows_estimation": [
{
"table": "`states`",
"table_scan": {
"rows": 4120,
"cost": 12
}
}
]
},
{
"considered_execution_plans": [
{
"plan_prefix": [
],
"table": "`states`",
"best_access_path": {
"considered_access_paths": [
{
"access_type": "scan",
"rows": 4120,
"cost": 836,
"chosen": true
}
]
},
"cost_for_plan": 836,
"rows_for_plan": 4120,
"chosen": true
}
]
},
{
"attaching_conditions_to_tables": {
"original_condition": "(`states`.`country_id` < 100)",
"attached_conditions_computation": [
],
"attached_conditions_summary": [
{
"table": "`states`",
"attached": "(`states`.`country_id` < 100)"
}
]
}
},
{
"refine_plan": [
{
"table": "`states`",
"access_type": "table_scan"
}
]
}
]
}
},
{
"join_optimization": {
"select#": 2,
"steps": [
{
"condition_processing": {
"condition": "WHERE",
"original_condition": "(`countries`.`id` > 10)",
"steps": [
{
"transformation": "equality_propagation",
"resulting_condition": "(`countries`.`id` > 10)"
},
{
"transformation": "constant_propagation",
"resulting_condition": "(`countries`.`id` > 10)"
},
{
"transformation": "trivial_condition_removal",
"resulting_condition": "(`countries`.`id` > 10)"
}
]
}
},
{
"table_dependencies": [
{
"table": "`countries`",
"row_may_be_null": false,
"map_bit": 0,
"depends_on_map_bits": [
]
}
]
},
{
"ref_optimizer_key_uses": [
]
},
{
"rows_estimation": [
{
"table": "`countries`",
"range_analysis": {
"table_scan": {
"rows": 246,
"cost": 52.3
},
"potential_range_indices": [
{
"index": "PRIMARY",
"usable": true,
"key_parts": [
"id"
]
}
],
"best_covering_index_scan": {
"index": "PRIMARY",
"cost": 50.439,
"chosen": true
},
"setup_range_conditions": [
],
"group_index_range": {
"chosen": false,
"cause": "not_group_by_or_distinct"
},
"analyzing_range_alternatives": {
"range_scan_alternatives": [
{
"index": "PRIMARY",
"ranges": [
"10 < id"
],
"index_dives_for_eq_ranges": true,
"rowid_ordered": true,
"using_mrr": false,
"index_only": true,
"rows": 236,
"cost": 48.419,
"chosen": true
}
],
"analyzing_roworder_intersect": {
"usable": false,
"cause": "too_few_roworder_scans"
}
},
"chosen_range_access_summary": {
"range_access_plan": {
"type": "range_scan",
"index": "PRIMARY",
"rows": 236,
"ranges": [
"10 < id"
]
},
"rows_for_plan": 236,
"cost_for_plan": 48.419,
"chosen": true
}
}
}
]
},
{
"considered_execution_plans": [
{
"plan_prefix": [
],
"table": "`countries`",
"best_access_path": {
"considered_access_paths": [
{
"access_type": "range",
"rows": 236,
"cost": 95.619,
"chosen": true
}
]
},
"cost_for_plan": 95.619,
"rows_for_plan": 236,
"chosen": true
}
]
},
{
"attaching_conditions_to_tables": {
"original_condition": "(`countries`.`id` > 10)",
"attached_conditions_computation": [
],
"attached_conditions_summary": [
{
"table": "`countries`",
"attached": "(`countries`.`id` > 10)"
}
]
}
},
{
"refine_plan": [
{
"table": "`countries`",
"access_type": "range"
}
]
}
]
}
},
{
"join_explain": {
"select#": 1,
"steps": [
]
}
},
{
"join_explain": {
"select#": 2,
"steps": [
]
}
},
{
"join_preparation": {
"select#": "fake",
"steps": [
{
"expanded_query": "/* select#fake */ select `id` AS `id` from dual"
}
]
}
},
{
"join_optimization": {
"select#": "fake",
"steps": [
{
"table_dependencies": [
{
"table": "``.``",
"row_may_be_null": false,
"map_bit": 0,
"depends_on_map_bits": [
]
}
]
},
{
"rows_estimation": [
{
"table": "``.``",
"table_scan": {
"rows": 0,
"cost": 10
}
}
]
},
{
"considered_execution_plans": [
{
"plan_prefix": [
],
"table": "``.``",
"best_access_path": {
"considered_access_paths": [
{
"access_type": "scan",
"rows": 0,
"cost": 10,
"chosen": true
}
]
},
"cost_for_plan": 10,
"rows_for_plan": 0,
"chosen": true
}
]
},
{
"attaching_conditions_to_tables": {
"original_condition": null,
"attached_conditions_computation": [
],
"attached_conditions_summary": [
{
"table": "``.``",
"attached": null
}
]
}
},
{
"refine_plan": [
{
"table": "``.``",
"access_type": "table_scan"
}
]
}
]
}
},
{
"join_explain": {
"select#": "fake",
"steps": [
]
}
}
]
}

最新文章

  1. SSH框架使用注解简化代码
  2. CSS3之过渡及2D变换
  3. hdu 2037 今年暑假不AC
  4. background复合属性详解(上):background-image
  5. java动态代理浅析
  6. iOS设计模式之单例模式
  7. 北航 编译实践 PL/0文法
  8. BZOJ K大数查询(分治)(Zjoi2013)
  9. json与jsonp应用及其他ajax数据交互方式
  10. 【转】企业级Java应用最重要的4个性能指标
  11. Node.js连接MySQL数据库及构造JSON的正确姿势
  12. nosql使用感受
  13. Linux显示包含全部的文件系统
  14. golang 通过exec Command启动的进程如何关闭的解决办法 以及隐藏黑色窗口
  15. C#常见金额优选类型及其三种常用的取整方式
  16. 【shiro】(4)---Shiro认证、授权案例讲解
  17. JS事件(五)内存与性能
  18. Pandas三个数据结构
  19. &quot;上市时间:&amp;nbsp;2014&amp;#24180;&amp;#31179;&amp;#20908;&amp;#23395;&quot; unicode十进制编码转中文
  20. android的体系结构

热门文章

  1. css层叠样式表总结
  2. HDU 6386 Age of Moyu 【BFS + 优先队列优化】
  3. 几句代码简单实现IoC容器
  4. 如何查看Windows下端口占用情况
  5. java和spring 线程池总结
  6. 简要的谈一谈我对CSS中长度单位的理解
  7. UIScrollView的常用属性
  8. CI框架下 ajax分页
  9. VM中Centos安装
  10. 如何在运行jar指定使用的JDK