{ "steps": [ { "join_preparation": { "select#": 1, "steps": [ { "expanded_query": "/* select#1 */ select count(distinct `tt`.`a`) AS `count(distinct a)` from `tt`" } ] } }, { "join_optimization": { "select#": 1, "steps": [ { "table_dependencies": [ { "table": "`tt`", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [ ] } ] }, { "rows_estimation": [ { "table": "`tt`", "const_keys_added": { "keys": [ "PRIMARY", "d" ], "cause": "indexed_distinct_aggregate" }, "range_analysis": { "table_scan": { "rows": 10462320, "cost": 2.12e6 }, "potential_range_indexes": [ { "index": "PRIMARY", "usable": true, "key_parts": [ "a", "b", "c", "d" ] }, { "index": "d", "usable": true, "key_parts": [ "d", "a", "b", "c" ] } ], "best_covering_index_scan": { "index": "d", "cost": 2.12e6, "chosen": true }, "group_index_range": { "potential_group_range_indexes": [ { "index": "PRIMARY", "covering": true, "usable": false, "cause": "primary_key_is_clustered" }, { "index": "d", "covering": true } ] } } } ] }, { "considered_execution_plans": [ { "plan_prefix": [ ], "table": "`tt`", "best_access_path": { "considered_access_paths": [ { "rows_to_scan": 10462320, "access_type": "scan", "resulting_rows": 1.05e7, "cost": 2.12e6, "chosen": true } ] }, "condition_filtering_pct": 100, "rows_for_plan": 1.05e7, "cost_for_plan": 2.12e6, "chosen": true } ] }, { "attaching_conditions_to_tables": { "original_condition": null, "attached_conditions_computation": [ ], "attached_conditions_summary": [ { "table": "`tt`", "attached": null } ] } }, { "refine_plan": [ { "table": "`tt`" } ] }, { "creating_tmp_table": { "tmp_table_info": { "table": "intermediate_tmp_table", "row_length": 5, "key_length": 4, "unique_constraint": false, "location": "memory (heap)", "row_limit_estimate": 3355443 } } } ] } }, { "join_execution": { "select#": 1, "steps": [ ] } } ] }