Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
{
"steps": [
{
"join_preparation": {
"select#": 1,
"steps": [
{
"expanded_query": "/* select#1 */ select `t_tbl_test_time_08`.`f_some_id` AS `f_some_id` from `t_tbl_test_time_08` where ((`t_tbl_test_time_08`.`f_qiye_id` = 5077665) and (`t_tbl_test_time_08`.`f_type` = 9) and (`t_tbl_test_time_08`.`f_contact_time` > '2017-10-17 14:23:49') and (`t_tbl_test_time_08`.`f_contact_time` < '2017-10-17 14:23:53')) order by `t_tbl_test_time_08`.`f_some_id` limit 300"
}
]
}
},
{
"join_optimization": {
"select#": 1,
"steps": [
{
"condition_processing": {
"condition": "WHERE",
"original_condition": "((`t_tbl_test_time_08`.`f_qiye_id` = 5077665) and (`t_tbl_test_time_08`.`f_type` = 9) and (`t_tbl_test_time_08`.`f_contact_time` > '2017-10-17 14:23:49') and (`t_tbl_test_time_08`.`f_contact_time` < '2017-10-17 14:23:53'))",
"steps": [
{
"transformation": "equality_propagation",
"resulting_condition": "((`t_tbl_test_time_08`.`f_contact_time` > '2017-10-17 14:23:49') and (`t_tbl_test_time_08`.`f_contact_time` < '2017-10-17 14:23:53') and multiple equal(5077665, `t_tbl_test_time_08`.`f_qiye_id`) and multiple equal(9, `t_tbl_test_time_08`.`f_type`))"
},
{
"transformation": "constant_propagation",
"resulting_condition": "((`t_tbl_test_time_08`.`f_contact_time` > '2017-10-17 14:23:49') and (`t_tbl_test_time_08`.`f_contact_time` < '2017-10-17 14:23:53') and multiple equal(5077665, `t_tbl_test_time_08`.`f_qiye_id`) and multiple equal(9, `t_tbl_test_time_08`.`f_type`))"
},
{
"transformation": "trivial_condition_removal",
"resulting_condition": "((`t_tbl_test_time_08`.`f_contact_time` > '2017-10-17 14:23:49') and (`t_tbl_test_time_08`.`f_contact_time` < '2017-10-17 14:23:53') and multiple equal(5077665, `t_tbl_test_time_08`.`f_qiye_id`) and multiple equal(9, `t_tbl_test_time_08`.`f_type`))"
}
]
}
},
{
"table_dependencies": [
{
"table": "`t_tbl_test_time_08`",
"row_may_be_null": false,
"map_bit": 0,
"depends_on_map_bits": [
]
}
]
},
{
"ref_optimizer_key_uses": [
]
},
{
"rows_estimation": [
{
"table": "`t_tbl_test_time_08`",
"range_analysis": {
"table_scan": {
"rows": 19264318,
"cost": 3.91e6
},
"potential_range_indices": [
{
"index": "some_qiye_type",
"usable": false,
"cause": "not_applicable"
},
{
"index": "f_contact_time",
"usable": true,
"key_parts": [
"f_contact_time"
]
}
],
"setup_range_conditions": [
],
"group_index_range": {
"chosen": false,
"cause": "not_group_by_or_distinct"
},
"analyzing_range_alternatives": {
"range_scan_alternatives": [
{
"index": "f_contact_time",
"ranges": [
"2017-10-17 14:23:49 < f_contact_time < 2017-10-17 14:23:53"
],
"index_dives_for_eq_ranges": true,
"rowid_ordered": false,
"using_mrr": true,
"index_only": false,
"rows": 360478,
"cost": 414128,
"chosen": true
}
],
"analyzing_roworder_intersect": {
"usable": false,
"cause": "too_few_roworder_scans"
}
},
"chosen_range_access_summary": {
"range_access_plan": {
"type": "range_scan",
"index": "f_contact_time",
"rows": 360478,
"ranges": [
"2017-10-17 14:23:49 < f_contact_time < 2017-10-17 14:23:53"
]
},
"rows_for_plan": 360478,
"cost_for_plan": 414128,
"chosen": true
}
}
}
]
},
{
"considered_execution_plans": [
{
"plan_prefix": [
],
"table": "`t_tbl_test_time_08`",
"best_access_path": {
"considered_access_paths": [
{
"access_type": "range",
"rows": 360478,
"cost": 486224,
"chosen": true
}
]
},
"cost_for_plan": 486224,
"rows_for_plan": 360478,
"chosen": true
}
]
},
{
"attaching_conditions_to_tables": {
"original_condition": "((`t_tbl_test_time_08`.`f_type` = 9) and (`t_tbl_test_time_08`.`f_qiye_id` = 5077665) and (`t_tbl_test_time_08`.`f_contact_time` > '2017-10-17 14:23:49') and (`t_tbl_test_time_08`.`f_contact_time` < '2017-10-17 14:23:53'))",
"attached_conditions_computation": [
{
"table": "`t_tbl_test_time_08`",
"rechecking_index_usage": {
"recheck_reason": "low_limit",
"limit": 300,
"row_estimate": 360478
}
}
],
"attached_conditions_summary": [
{
"table": "`t_tbl_test_time_08`",
"attached": "((`t_tbl_test_time_08`.`f_type` = 9) and (`t_tbl_test_time_08`.`f_qiye_id` = 5077665) and (`t_tbl_test_time_08`.`f_contact_time` > '2017-10-17 14:23:49') and (`t_tbl_test_time_08`.`f_contact_time` < '2017-10-17 14:23:53'))"
}
]
}
},
{
"clause_processing": {
"clause": "ORDER BY",
"original_clause": "`t_tbl_test_time_08`.`f_some_id`",
"items": [
{
"item": "`t_tbl_test_time_08`.`f_some_id`"
}
],
"resulting_clause_is_simple": true,
"resulting_clause": "`t_tbl_test_time_08`.`f_some_id`"
}
},
{
"refine_plan": [
{
"table": "`t_tbl_test_time_08`",
"pushed_index_condition": "((`t_tbl_test_time_08`.`f_contact_time` > '2017-10-17 14:23:49') and (`t_tbl_test_time_08`.`f_contact_time` < '2017-10-17 14:23:53'))",
"table_condition_attached": "((`t_tbl_test_time_08`.`f_type` = 9) and (`t_tbl_test_time_08`.`f_qiye_id` = 5077665))",
"access_type": "range"
}
]
},
{
"reconsidering_access_paths_for_index_ordering": {
"clause": "ORDER BY",
"index_order_summary": {
"table": "`t_tbl_test_time_08`",
"index_provides_order": true,
"order_direction": "asc",
"disabled_pushed_condition_on_old_index": true,
"index": "some_qiye_type",
"plan_changed": true,
"access_type": "index_scan"
}
}
}
]
}
},
{
"join_execution": {
"select#": 1,
"steps": [
]
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment