{ "steps": [ { "join_preparation": { "select#": 1, "steps": [ { "IN_uses_bisection": true }, { "expanded_query": "/* select#1 */ select `t1`.`a` AS `a`,`t1`.`b` AS `b`,`t2`.`a` AS `a`,`t2`.`b` AS `b` from `t1` join `t2` where ((`t1`.`a` < 50) and (`t1`.`b` = `t2`.`b`) and (`t2`.`a` in (1,2,3)))" } ] } }, { "join_optimization": { "select#": 1, "steps": [ { "condition_processing": { "condition": "WHERE", "original_condition": "((`t1`.`a` < 50) and (`t1`.`b` = `t2`.`b`) and (`t2`.`a` in (1,2,3)))", "steps": [ { "transformation": "equality_propagation", "resulting_condition": "((`t1`.`a` < 50) and (`t2`.`a` in (1,2,3)) and multiple equal(`t1`.`b`, `t2`.`b`))" }, { "transformation": "constant_propagation", "resulting_condition": "((`t1`.`a` < 50) and (`t2`.`a` in (1,2,3)) and multiple equal(`t1`.`b`, `t2`.`b`))" }, { "transformation": "trivial_condition_removal", "resulting_condition": "((`t1`.`a` < 50) and (`t2`.`a` in (1,2,3)) and multiple equal(`t1`.`b`, `t2`.`b`))" } ] } }, { "substitute_generated_columns": { } }, { "table_dependencies": [ { "table": "`t1`", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [ ] }, { "table": "`t2`", "row_may_be_null": false, "map_bit": 1, "depends_on_map_bits": [ ] } ] }, { "ref_optimizer_key_uses": [ ] }, { "rows_estimation": [ { "table": "`t1`", "range_analysis": { "table_scan": { "rows": 1000, "cost": 103.1 }, "potential_range_indexes": [ { "index": "a", "usable": true, "key_parts": [ "a" ] } ], "setup_range_conditions": [ ], "group_index_range": { "chosen": false, "cause": "not_single_table" }, "analyzing_range_alternatives": { "range_scan_alternatives": [ { "index": "a", "ranges": [ "NULL < a < 50" ], "index_dives_for_eq_ranges": true, "rowid_ordered": false, "using_mrr": false, "index_only": false, "rows": 50, "cost": 17.76, "chosen": true } ], "analyzing_roworder_intersect": { "usable": false, "cause": "too_few_roworder_scans" } }, "chosen_range_access_summary": { "range_access_plan": { "type": "range_scan", "index": "a", "rows": 50, "ranges": [ "NULL < a < 50" ] }, "rows_for_plan": 50, "cost_for_plan": 17.76, "chosen": true } } }, { "table": "`t2`", "range_analysis": { "table_scan": { "rows": 1000, "cost": 103.1 }, "potential_range_indexes": [ { "index": "a", "usable": true, "key_parts": [ "a" ] } ], "setup_range_conditions": [ ], "group_index_range": { "chosen": false, "cause": "not_single_table" }, "analyzing_range_alternatives": { "range_scan_alternatives": [ { "index": "a", "ranges": [ "1 <= a <= 1", "2 <= a <= 2", "3 <= a <= 3" ], "index_dives_for_eq_ranges": true, "rowid_ordered": false, "using_mrr": false, "index_only": false, "rows": 3, "cost": 1.81, "chosen": true } ], "analyzing_roworder_intersect": { "usable": false, "cause": "too_few_roworder_scans" } }, "chosen_range_access_summary": { "range_access_plan": { "type": "range_scan", "index": "a", "rows": 3, "ranges": [ "1 <= a <= 1", "2 <= a <= 2", "3 <= a <= 3" ] }, "rows_for_plan": 3, "cost_for_plan": 1.81, "chosen": true } } } ] }, { "considered_execution_plans": [ { "plan_prefix": [ ], "table": "`t2`", "best_access_path": { "considered_access_paths": [ { "rows_to_scan": 3, "filtering_effect": [ ], "final_filtering_effect": 1, "access_type": "range", "range_details": { "used_index": "a" }, "resulting_rows": 3, "cost": 2.11, "chosen": true } ] }, "condition_filtering_pct": 100, "rows_for_plan": 3, "cost_for_plan": 2.11, "rest_of_plan": [ { "plan_prefix": [ "`t2`" ], "table": "`t1`", "best_access_path": { "considered_access_paths": [ { "rows_to_scan": 50, "filtering_effect": [ ], "final_filtering_effect": 1, "access_type": "range", "range_details": { "used_index": "a" }, "resulting_rows": 50, "cost": 68.28, "chosen": true } ] }, "condition_filtering_pct": 10, "rows_for_plan": 15, "cost_for_plan": 70.39, "chosen": true } ] }, { "plan_prefix": [ ], "table": "`t1`", "best_access_path": { "considered_access_paths": [ { "rows_to_scan": 50, "filtering_effect": [ ], "final_filtering_effect": 1, "access_type": "range", "range_details": { "used_index": "a" }, "resulting_rows": 50, "cost": 22.76, "chosen": true } ] }, "condition_filtering_pct": 100, "rows_for_plan": 50, "cost_for_plan": 22.76, "pruned_by_heuristic": true } ] }, { "attaching_conditions_to_tables": { "original_condition": "((`t1`.`b` = `t2`.`b`) and (`t1`.`a` < 50) and (`t2`.`a` in (1,2,3)))", "attached_conditions_computation": [ ], "attached_conditions_summary": [ { "table": "`t2`", "attached": "(`t2`.`a` in (1,2,3))" }, { "table": "`t1`", "attached": "((`t1`.`b` = `t2`.`b`) and (`t1`.`a` < 50))" } ] } }, { "refine_plan": [ { "table": "`t2`", "pushed_index_condition": "(`t2`.`a` in (1,2,3))", "table_condition_attached": null }, { "table": "`t1`", "unknown_key_1": { "constant_condition_in_bnl": "(`t1`.`a` < 50)" }, "pushed_index_condition": "(`t1`.`a` < 50)", "table_condition_attached": "(`t1`.`b` = `t2`.`b`)" } ] } ] } }, { "join_explain": { "select#": 1, "steps": [ ] } } ] }