{
"steps": [
{
"join_preparation": {
"select#": 1,
"steps": [
{
"IN_uses_bisection": true
},
{
"expanded_query": "/* select#1 */ select `order_exp`.`id` AS `id`,`order_exp`.`order_no` AS `order_no`,`order_exp`.`order_note` AS `order_note`,`order_exp`.`insert_time` AS `insert_time`,`order_exp`.`expire_duration` AS `expire_duration`,`order_exp`.`expire_time` AS `expire_time`,`order_exp`.`order_status` AS `order_status` from `order_exp` where ((`order_exp`.`order_no` in ('DD00_6S','DD00_9S','DD00_10S')) and (`order_exp`.`expire_time` > '2021-03-22 18:28:28') and (`order_exp`.`insert_time` > '2021-03-22 18:35:09') and (`order_exp`.`order_note` like '%7排1%'))"
}
]
}
},
{
"join_optimization": {
"select#": 1,
"steps": [
{
"condition_processing": {
"condition": "WHERE",
"original_condition": "((`order_exp`.`order_no` in ('DD00_6S','DD00_9S','DD00_10S')) and (`order_exp`.`expire_time` > '2021-03-22 18:28:28') and (`order_exp`.`insert_time` > '2021-03-22 18:35:09') and (`order_exp`.`order_note` like '%7排1%'))",
"steps": [
{
"transformation": "equality_propagation",
"resulting_condition": "((`order_exp`.`order_no` in ('DD00_6S','DD00_9S','DD00_10S')) and (`order_exp`.`expire_time` > '2021-03-22 18:28:28') and (`order_exp`.`insert_time` > '2021-03-22 18:35:09') and (`order_exp`.`order_note` like '%7排1%'))"
},
{
"transformation": "constant_propagation",
"resulting_condition": "((`order_exp`.`order_no` in ('DD00_6S','DD00_9S','DD00_10S')) and (`order_exp`.`expire_time` > '2021-03-22 18:28:28') and (`order_exp`.`insert_time` > '2021-03-22 18:35:09') and (`order_exp`.`order_note` like '%7排1%'))"
},
{
"transformation": "trivial_condition_removal",
"resulting_condition": "((`order_exp`.`order_no` in ('DD00_6S','DD00_9S','DD00_10S')) and (`order_exp`.`expire_time` > '2021-03-22 18:28:28') and (`order_exp`.`insert_time` > '2021-03-22 18:35:09') and (`order_exp`.`order_note` like '%7排1%'))"
}
]
}
},
{
"substitute_generated_columns": {
}
},
{
"table_dependencies": [
{
"table": "`order_exp`",
"row_may_be_null": false,
"map_bit": 0,
"depends_on_map_bits": [
]
}
]
},
{
"ref_optimizer_key_uses": [
]
},
{
"rows_estimation": [
{
"table": "`order_exp`",
"range_analysis": {
"table_scan": {
"rows": 10373,
"cost": 2173.7
},
"potential_range_indexes": [
{
"index": "PRIMARY",
"usable": false,
"cause": "not_applicable"
},
{
"index": "u_idx_day_status",
"usable": true,
"key_parts": [
"insert_time",
"order_status",
"expire_time"
]
},
{
"index": "idx_order_no",
"usable": true,
"key_parts": [
"order_no",
"id"
]
},
{
"index": "idx_expire_time",
"usable": true,
"key_parts": [
"expire_time",
"id"
]
}
],
"setup_range_conditions": [
],
"group_index_range": {
"chosen": false,
"cause": "not_group_by_or_distinct"
},
"analyzing_range_alternatives": {
"range_scan_alternatives": [
{
"index": "u_idx_day_status",
"ranges": [
"0x99a92d28c9 < insert_time"
],
"index_dives_for_eq_ranges": true,
"rowid_ordered": false,
"using_mrr": false,
"index_only": false,
"rows": 5186,
"cost": 6224.2,
"chosen": false,
"cause": "cost"
},
{
"index": "idx_order_no",
"ranges": [
"DD00_10S <= order_no <= DD00_10S",
"DD00_6S <= order_no <= DD00_6S",
"DD00_9S <= order_no <= DD00_9S"
],
"index_dives_for_eq_ranges": true,
"rowid_ordered": false,
"using_mrr": false,
"index_only": false,
"rows": 58,
"cost": 72.61,
"chosen": true
},
{
"index": "idx_expire_time",
"ranges": [
"0x99a92d271c < expire_time"
],
"index_dives_for_eq_ranges": true,
"rowid_ordered": false,
"using_mrr": false,
"index_only": false,
"rows": 5186,
"cost": 6224.2,
"chosen": false,
"cause": "cost"
}
],
"analyzing_roworder_intersect": {
"usable": false,
"cause": "too_few_roworder_scans"
}
},
"chosen_range_access_summary": {
"range_access_plan": {
"type": "range_scan",
"index": "idx_order_no",
"rows": 58,
"ranges": [
"DD00_10S <= order_no <= DD00_10S",
"DD00_6S <= order_no <= DD00_6S",
"DD00_9S <= order_no <= DD00_9S"
]
},
"rows_for_plan": 58,
"cost_for_plan": 72.61,
"chosen": true
}
}
}
]
},
{
"considered_execution_plans": [
{
"plan_prefix": [
],
"table": "`order_exp`",
"best_access_path": {
"considered_access_paths": [
{
"rows_to_scan": 58,
"access_type": "range",
"range_details": {
"used_index": "idx_order_no"
},
"resulting_rows": 58,
"cost": 84.21,
"chosen": true
}
]
},
"condition_filtering_pct": 100,
"rows_for_plan": 58,
"cost_for_plan": 84.21,
"chosen": true
}
]
},
{
"attaching_conditions_to_tables": {
"original_condition": "((`order_exp`.`order_no` in ('DD00_6S','DD00_9S','DD00_10S')) and (`order_exp`.`expire_time` > '2021-03-22 18:28:28') and (`order_exp`.`insert_time` > '2021-03-22 18:35:09') and (`order_exp`.`order_note` like '%7排1%'))",
"attached_conditions_computation": [
],
"attached_conditions_summary": [
{
"table": "`order_exp`",
"attached": "((`order_exp`.`order_no` in ('DD00_6S','DD00_9S','DD00_10S')) and (`order_exp`.`expire_time` > '2021-03-22 18:28:28') and (`order_exp`.`insert_time` > '2021-03-22 18:35:09') and (`order_exp`.`order_note` like '%7排1%'))"
}
]
}
},
{
"refine_plan": [
{
"table": "`order_exp`",
"pushed_index_condition": "(`order_exp`.`order_no` in ('DD00_6S','DD00_9S','DD00_10S'))",
"table_condition_attached": "((`order_exp`.`expire_time` > '2021-03-22 18:28:28') and (`order_exp`.`insert_time` > '2021-03-22 18:35:09') and (`order_exp`.`order_note` like '%7排1%'))"
}
]
}
]
}
},
{
"join_execution": {
"select#": 1,
"steps": [
]
}
}
]
}
mysql 执行计划分析
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 在查询sql执行时间,查看sql执行计划的时候。发现自己数据量太少,时间差距不明显。来来来,给你一千万条数据。 一...
- 最近一次在数据库查询一条数据时,发现查询速度变得巨慢,看了一下查询的where条件也的确是索引字段,因为是基础服务...
- 第8章 执行计划获取和分析 1.命令介绍 分析你的SQL查询语句走不走索引 2.使用方法 desc select ...
- 目标 分析模糊查询sql的索引利用问题,执行计划结果含义学习可参考博客https://blog.csdn.net/...