MariaDB [tpch]> source Q2-json.sql; +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ANALYZE | +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | { "query_optimization": { "r_total_time_ms": 0.707500043 }, "query_block": { "select_id": 1, "cost": 392.6835539, "r_loops": 1, "r_total_time_ms": 67.06617083, "filesort": { "sort_key": "SUPPLIER.S_ACCTBAL desc, NATION.N_NAME, SUPPLIER.S_NAME, PART.P_PARTKEY", "r_loops": 1, "r_total_time_ms": 0.106430845, "r_limit": 100, "r_used_priority_queue": true, "r_output_rows": 101, "r_sort_mode": "sort_key,rowid", "temporary_table": { "nested_loop": [ { "table": { "table_name": "PART", "access_type": "ALL", "possible_keys": ["PRIMARY"], "loops": 1, "r_loops": 1, "rows": 198072, "r_rows": 200000, "cost": 34.022432, "r_table_time_ms": 38.62080754, "r_other_time_ms": 10.79503464, "r_engine_stats": { "pages_accessed": 1971 }, "filtered": 19, "r_filtered": 0.3865, "attached_condition": "PART.P_SIZE = 30 and PART.P_TYPE like '%STEEL'" } }, { "table": { "table_name": "PARTSUPP", "access_type": "ref", "possible_keys": [ "PRIMARY", "PARTSUPP_PART_FKIDX", "PARTSUPP_SUPPLIER_FKIDX" ], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["PS_PARTKEY"], "ref": ["tpch.PART.P_PARTKEY"], "loops": 37633.68, "r_loops": 773, "rows": 3, "r_rows": 4, "cost": 55.5779736, "r_table_time_ms": 3.380847461, "r_other_time_ms": 0.789274544, "r_engine_stats": { "pages_accessed": 2361 }, "filtered": 100, "r_filtered": 15.20051746, "attached_condition": "PARTSUPP.PS_SUPPLYCOST = (subquery#2)" } }, { "table": { "table_name": "SUPPLIER", "access_type": "eq_ref", "possible_keys": ["PRIMARY", "SUPPLIER_NATION_FKIDX"], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["S_SUPPKEY"], "ref": ["tpch.PARTSUPP.PS_SUPPKEY"], "loops": 112901.04, "r_loops": 470, "rows": 1, "r_rows": 1, "cost": 101.1150974, "r_table_time_ms": 0.593271087, "r_other_time_ms": 0.110052352, "r_engine_stats": { "pages_accessed": 949 }, "filtered": 100, "r_filtered": 100, "attached_condition": "SUPPLIER.S_NATIONKEY is not null" } }, { "table": { "table_name": "NATION", "access_type": "eq_ref", "possible_keys": ["PRIMARY", "NATION_REGIONKEY_FKIDX"], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["N_NATIONKEY"], "ref": ["tpch.SUPPLIER.S_NATIONKEY"], "loops": 112901.04, "r_loops": 470, "r_table_loops": 378, "rows": 1, "r_rows": 1, "cost": 100.9840254, "r_table_time_ms": 0.234493089, "r_other_time_ms": 0.254851109, "r_engine_stats": { "pages_accessed": 378 }, "filtered": 100, "r_filtered": 100, "attached_condition": "NATION.N_REGIONKEY is not null" } }, { "table": { "table_name": "REGION", "access_type": "eq_ref", "possible_keys": ["PRIMARY"], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["R_REGIONKEY"], "ref": ["tpch.NATION.N_REGIONKEY"], "loops": 112901.04, "r_loops": 470, "r_table_loops": 3, "rows": 1, "r_rows": 1, "cost": 100.9840254, "r_table_time_ms": 0.003156028, "r_other_time_ms": 0.010148914, "r_engine_stats": { "pages_accessed": 3 }, "filtered": 100, "r_filtered": 99.78723404, "attached_condition": "REGION.R_NAME = 'ASIA'" } } ], "subqueries": [ { "subquery_cache": { "r_loops": 3092, "r_hit_ratio": 75, "query_block": { "select_id": 2, "cost": 0.01425573, "r_loops": 773, "r_total_time_ms": 11.78610438, "nested_loop": [ { "table": { "table_name": "PARTSUPP", "access_type": "ref", "possible_keys": [ "PRIMARY", "PARTSUPP_PART_FKIDX", "PARTSUPP_SUPPLIER_FKIDX" ], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["PS_PARTKEY"], "ref": ["tpch.PART.P_PARTKEY"], "loops": 1, "r_loops": 773, "rows": 3, "r_rows": 4, "cost": 0.00210977, "r_table_time_ms": 1.725111449, "r_other_time_ms": 0.692491689, "r_engine_stats": { "pages_accessed": 2361 }, "filtered": 100, "r_filtered": 100 } }, { "table": { "table_name": "SUPPLIER", "access_type": "eq_ref", "possible_keys": ["PRIMARY", "SUPPLIER_NATION_FKIDX"], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["S_SUPPKEY"], "ref": ["tpch.PARTSUPP.PS_SUPPKEY"], "loops": 3, "r_loops": 3092, "rows": 1, "r_rows": 1, "cost": 0.00514092, "r_table_time_ms": 4.618826741, "r_other_time_ms": 0.460132714, "r_engine_stats": { "pages_accessed": 6250 }, "filtered": 100, "r_filtered": 100, "attached_condition": "SUPPLIER.S_NATIONKEY is not null" } }, { "table": { "table_name": "NATION", "access_type": "eq_ref", "possible_keys": ["PRIMARY", "NATION_REGIONKEY_FKIDX"], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["N_NATIONKEY"], "ref": ["tpch.SUPPLIER.S_NATIONKEY"], "loops": 3, "r_loops": 3092, "r_table_loops": 3001, "rows": 1, "r_rows": 1, "cost": 0.00350252, "r_table_time_ms": 1.719268216, "r_other_time_ms": 0.502358216, "r_engine_stats": { "pages_accessed": 3001 }, "filtered": 100, "r_filtered": 100, "attached_condition": "NATION.N_REGIONKEY is not null" } }, { "table": { "table_name": "REGION", "access_type": "eq_ref", "possible_keys": ["PRIMARY"], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["R_REGIONKEY"], "ref": ["tpch.NATION.N_REGIONKEY"], "loops": 3, "r_loops": 3092, "r_table_loops": 2630, "rows": 1, "r_rows": 1, "cost": 0.00350252, "r_table_time_ms": 1.283018723, "r_other_time_ms": 0.479292259, "r_engine_stats": { "pages_accessed": 2630 }, "filtered": 100, "r_filtered": 21.02199224, "attached_condition": "REGION.R_NAME = 'ASIA'" } } ] } } } ] } } } } | +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.069 sec) MariaDB [tpch]> notee