+select * from information_schema.optimizer_trace limit 1; +QUERY SELECT * FROM t2 WHERE id <= 3 +TRACE { + "steps": [ + { + "join_preparation": { + "select_id": 1, + "steps": [ + { + "expanded_query": "select t2.`id` AS `id`,t2.msg AS msg from t2 where t2.`id` <= 3" + } + ] + } + }, + { + "join_optimization": { + "select_id": 1, + "steps": [ + { + "condition_processing": { + "condition": "WHERE", + "original_condition": "t2.`id` <= 3", + "steps": [ + { + "transformation": "equality_propagation", + "resulting_condition": "t2.`id` <= 3" + }, + { + "transformation": "constant_propagation", + "resulting_condition": "t2.`id` <= 3" + }, + { + "transformation": "trivial_condition_removal", + "resulting_condition": "t2.`id` <= 3" + } + ] + } + }, + { + "table_dependencies": [ + { + "table": "t2", + "row_may_be_null": false, + "map_bit": 0, + "depends_on_map_bits": [] + } + ] + }, + { + "ref_optimizer_key_uses": [] + }, + { + "rows_estimation": [ + { + "table": "t2", + "range_analysis": { + "table_scan": { + "rows": 7, + "cost": 0.113371474 + }, + "potential_range_indexes": [ + { + "index": "PRIMARY", + "usable": true, + "key_parts": ["id"] + } + ], + "setup_range_conditions": [], + "analyzing_range_alternatives": { + "range_scan_alternatives": [ + { + "index": "PRIMARY", + "ranges": ["(id) <= (3)"], + "rowid_ordered": false, + "using_mrr": false, + "index_only": false, + "rows": 2, + "cost": 0.004554858, + "chosen": true + } + ], + "analyzing_roworder_intersect": { + "cause": "too few roworder scans" + }, + "analyzing_index_merge_union": [] + }, + "group_index_range": { + "chosen": false, + "cause": "no group by or distinct" + }, + "chosen_range_access_summary": { + "range_access_plan": { + "type": "range_scan", + "index": "PRIMARY", + "rows": 2, + "ranges": ["(id) <= (3)"] + }, + "rows_for_plan": 2, + "cost_for_plan": 0.004554858, + "chosen": true + } + } + }, + { + "selectivity_for_indexes": [ + { + "index_name": "PRIMARY", + "selectivity_from_index": 0.285714286 + } + ], + "selectivity_for_columns": [], + "cond_selectivity": 0.285714286 + } + ] + }, + { + "considered_execution_plans": [ + { + "plan_prefix": "", + "get_costs_for_tables": [ + { + "best_access_path": { + "table": "t2", + "plan_details": { + "record_count": 1 + }, + "considered_access_paths": [ + { + "access_type": "range", + "range_index": "PRIMARY", + "rows": 2, + "rows_after_filter": 2, + "rows_out": 2, + "cost": 0.004554858, + "chosen": true + } + ], + "chosen_access_method": { + "type": "range", + "index": "PRIMARY", + "rows_read": 2, + "rows_out": 2, + "cost": 0.004554858, + "uses_join_buffering": false + } + } + } + ] + }, + { + "plan_prefix": "", + "table": "t2", + "rows_for_plan": 2, + "cost_for_plan": 0.004554858 + } + ] + }, + { + "best_join_order": ["t2"], + "rows": 2, + "cost": 0.004554858 + }, + { + "substitute_best_equal": { + "condition": "WHERE", + "resulting_condition": "t2.`id` <= 3" + } + }, + { + "attaching_conditions_to_tables": { + "attached_conditions_computation": [ + { + "table_condition_pushdown": { + "table": "t2", + "push_cond": "t2.`id` <= 3" + } + } + ], + "attached_conditions_summary": [ + { + "table": "t2", + "attached_condition": "t2.`id` <= 3" + } + ] + } + }, + { + "make_join_readinfo": [] + } + ] + } + } + ] +}