{ "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { "derived": { "table": "alias", "select_id": 2, "algorithm": "merged" } }, { "join_preparation": { "select_id": 2, "steps": [ { "expanded_query": "/* select#2 */ select t2.b AS b,t2.c AS c from t2" } ] } }, { "join_preparation": { "select_id": 3, "steps": [ { "expanded_query": "/* select#3 */ select 1 from t3 where t3.b = t3.c" } ] } }, { "expanded_query": "/* select#1 */ select max(alias1.a + alias.b + alias.c) AS `max(a+b+c)` from t1 alias1 join (/* select#2 */ select t2.b AS b,t2.c AS c from t2) alias where (1,exists(/* select#3 */ select 1 from t3 where t3.b = t3.c limit 1)) or alias1.a <= 10" } ] } }, { "join_optimization": { "select_id": 1, "steps": [ { "join_optimization": { "select_id": 3, "steps": [ { "condition_processing": { "condition": "WHERE", "original_condition": "t3.b = t3.c", "steps": [ { "transformation": "equality_propagation", "resulting_condition": "multiple equal(t3.b, t3.c)" }, { "transformation": "constant_propagation", "resulting_condition": "multiple equal(t3.b, t3.c)" }, { "transformation": "trivial_condition_removal", "resulting_condition": "multiple equal(t3.b, t3.c)" } ] } }, { "ref_optimizer_key_uses": [] }, { "rows_estimation": [ { "table": "t3", "table_scan": { "rows": 20, "read_cost": 0.0125237, "read_and_compare_cost": 0.0131637 } } ] }, { "table_dependencies": [ { "table": "t3", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] } ] }, { "considered_execution_plans": [ { "plan_prefix": "", "get_costs_for_tables": [ { "best_access_path": { "table": "t3", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { "access_type": "scan", "rows": 20, "rows_after_filter": 20, "rows_out": 20, "cost": 0.0131637, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "rows_read": 20, "rows_out": 20, "cost": 0.0131637, "uses_join_buffering": false } } } ] }, { "plan_prefix": "", "table": "t3", "rows_for_plan": 20, "cost_for_plan": 0.0131637 } ] }, { "best_join_order": ["t3"], "rows": 20, "cost": 0.0131637 }, { "substitute_best_equal": { "condition": "WHERE", "resulting_condition": "t3.c = t3.b" } }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { "table": "t3", "attached_condition": "t3.c = t3.b" } ] } }, { "make_join_readinfo": [] } ] } }, { "condition_processing": { "condition": "WHERE", "original_condition": "(1,exists(/* select#3 */ select 1 from t3 where t3.c = t3.b limit 1)) or alias1.a <= 10", "steps": [ { "transformation": "equality_propagation", "resulting_condition": "(1,exists(/* select#3 */ select 1 from t3 where t3.c = t3.b limit 1)) or alias1.a <= 10" }, { "transformation": "constant_propagation", "resulting_condition": "(1,exists(/* select#3 */ select 1 from t3 where t3.c = t3.b limit 1)) or alias1.a <= 10" }, { "transformation": "trivial_condition_removal", "resulting_condition": "alias1.a <= 10" } ] } }, { "ref_optimizer_key_uses": [] }, { "rows_estimation": [ { "selectivity_for_indexes": [], "selectivity_for_columns": [], "cond_selectivity": 1 }, { "table": "alias1", "table_scan": { "rows": 14, "read_cost": 0.01177727, "read_and_compare_cost": 0.01222527 } }, { "table": "t2", "table_scan": { "rows": 20, "read_cost": 0.0125237, "read_and_compare_cost": 0.0131637 } } ] }, { "table_dependencies": [ { "table": "alias1", "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": [] } ] }, { "considered_execution_plans": [ { "plan_prefix": "", "get_costs_for_tables": [ { "best_access_path": { "table": "alias1", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { "access_type": "scan", "rows": 14, "rows_after_filter": 14, "rows_out": 14, "cost": 0.01222527, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "rows_read": 14, "rows_out": 14, "cost": 0.01222527, "uses_join_buffering": false } } }, { "best_access_path": { "table": "t2", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { "access_type": "scan", "rows": 20, "rows_after_filter": 20, "rows_out": 20, "cost": 0.0131637, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "rows_read": 20, "rows_out": 20, "cost": 0.0131637, "uses_join_buffering": false } } } ] }, { "plan_prefix": "", "table": "alias1", "rows_for_plan": 14, "cost_for_plan": 0.01222527, "rest_of_plan": [ { "plan_prefix": "alias1", "get_costs_for_tables": [ { "best_access_path": { "table": "t2", "plan_details": { "record_count": 14 }, "considered_access_paths": [ { "access_type": "scan_with_join_cache", "rows": 20, "rows_after_filter": 20, "rows_out": 20, "cost": 0.040018304, "cost_without_join_buffer": 0.1842918, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "rows_read": 20, "rows_out": 20, "cost": 0.040018304, "uses_join_buffering": true } } } ] }, { "plan_prefix": "alias1", "table": "t2", "rows_for_plan": 280, "cost_for_plan": 0.052243574 } ] }, { "plan_prefix": "", "table": "t2", "rows_for_plan": 20, "cost_for_plan": 0.0131637, "pruned_by_heuristic": true } ] }, { "best_join_order": ["alias1", "t2"], "rows": 280, "cost": 0.052243574 }, { "substitute_best_equal": { "condition": "WHERE", "resulting_condition": "alias1.a <= 10" } }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { "table": "alias1", "attached_condition": "alias1.a <= 10" }, { "table": "t2", "attached_condition": null } ] } }, { "make_join_readinfo": [] }, { "prepare_sum_aggregators": { "function": "max(alias1.a + t2.b + t2.c)", "aggregator_type": "simple" } } ] } } ] }