Skip to content

Instantly share code, notes, and snippets.

@mdcallag
Created January 11, 2023 00:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
{
"steps": [
{
"join_preparation": {
"select#": 1,
"steps": [
{
"expanded_query": "/* select#1 */ select `pi1`.`price` AS `price`,`pi1`.`dateandtime` AS `dateandtime`,`pi1`.`customerid` AS `customerid` from `pi1` FORCE INDEX (`pi1_pdc`) where (`pi1`.`price` >= 852.366314) order by `pi1`.`price`,`pi1`.`dateandtime`,`pi1`.`customerid` limit 10"
}
]
}
},
{
"join_optimization": {
"select#": 1,
"steps": [
{
"condition_processing": {
"condition": "WHERE",
"original_condition": "(`pi1`.`price` >= 852.366314)",
"steps": [
{
"transformation": "equality_propagation",
"resulting_condition": "(`pi1`.`price` >= 852.366314)"
},
{
"transformation": "constant_propagation",
"resulting_condition": "(`pi1`.`price` >= 852.366314)"
},
{
"transformation": "trivial_condition_removal",
"resulting_condition": "(`pi1`.`price` >= 852.366314)"
}
]
}
},
{
"table_dependencies": [
{
"table": "`pi1` FORCE INDEX (`pi1_pdc`)",
"row_may_be_null": false,
"map_bit": 0,
"depends_on_map_bits": [
]
}
]
},
{
"ref_optimizer_key_uses": [
]
},
{
"rows_estimation": [
{
"table": "`pi1` FORCE INDEX (`pi1_pdc`)",
"range_analysis": {
"table_scan": {
"rows": 508579538,
"cost": 2e308
},
"potential_range_indices": [
{
"index": "PRIMARY",
"usable": false,
"cause": "not_applicable"
},
{
"index": "pi1_marketsegment",
"usable": false,
"cause": "not_applicable"
},
{
"index": "pi1_registersegment",
"usable": false,
"cause": "not_applicable"
},
{
"index": "pi1_pdc",
"usable": true,
"key_parts": [
"price",
"dateandtime",
"customerid",
"transactionid"
]
}
],
"best_covering_index_scan": {
"index": "pi1_pdc",
"cost": 1.03e8,
"chosen": true
},
"setup_range_conditions": [
],
"group_index_range": {
"chosen": false,
"cause": "not_group_by_or_distinct"
},
"analyzing_range_alternatives": {
"range_scan_alternatives": [
{
"index": "pi1_pdc",
"ranges": [
"852.366 <= price"
],
"index_dives_for_eq_ranges": true,
"rowid_ordered": false,
"using_mrr": false,
"index_only": true,
"rows": 154200716,
"cost": 3.13e7,
"chosen": true
}
],
"analyzing_roworder_intersect": {
"usable": false,
"cause": "too_few_roworder_scans"
}
},
"chosen_range_access_summary": {
"range_access_plan": {
"type": "range_scan",
"index": "pi1_pdc",
"rows": 154200716,
"ranges": [
"852.366 <= price"
]
},
"rows_for_plan": 154200716,
"cost_for_plan": 3.13e7,
"chosen": true
}
}
}
]
},
{
"considered_execution_plans": [
{
"plan_prefix": [
],
"table": "`pi1` FORCE INDEX (`pi1_pdc`)",
"best_access_path": {
"considered_access_paths": [
{
"access_type": "range",
"rows": 1.54e8,
"cost": 6.21e7,
"chosen": true
}
]
},
"cost_for_plan": 6.21e7,
"rows_for_plan": 1.54e8,
"chosen": true
}
]
},
{
"attaching_conditions_to_tables": {
"original_condition": "(`pi1`.`price` >= 852.366314)",
"attached_conditions_computation": [
{
"table": "`pi1` FORCE INDEX (`pi1_pdc`)",
"rechecking_index_usage": {
"recheck_reason": "low_limit",
"limit": 10,
"row_estimate": 1.54e8
}
}
],
"attached_conditions_summary": [
{
"table": "`pi1` FORCE INDEX (`pi1_pdc`)",
"attached": "(`pi1`.`price` >= 852.366314)"
}
]
}
},
{
"clause_processing": {
"clause": "ORDER BY",
"original_clause": "`pi1`.`price`,`pi1`.`dateandtime`,`pi1`.`customerid`",
"items": [
{
"item": "`pi1`.`price`"
},
{
"item": "`pi1`.`dateandtime`"
},
{
"item": "`pi1`.`customerid`"
}
],
"resulting_clause_is_simple": true,
"resulting_clause": "`pi1`.`price`,`pi1`.`dateandtime`,`pi1`.`customerid`"
}
},
{
"refine_plan": [
{
"table": "`pi1` FORCE INDEX (`pi1_pdc`)",
"access_type": "range"
}
]
},
{
"reconsidering_access_paths_for_index_ordering": {
"clause": "ORDER BY",
"index_order_summary": {
"table": "`pi1` FORCE INDEX (`pi1_pdc`)",
"index_provides_order": true,
"order_direction": "asc",
"index": "pi1_pdc",
"plan_changed": false
}
}
}
]
}
},
{
"join_execution": {
"select#": 1,
"steps": [
]
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment