MariaDB [federated]> analyze format=json DELETE -> -> FROM -> -> OUTR1 USING D AS OUTR1 -> -> RIGHT JOIN -> -> ( B AS OUTR2 JOIN D AS OUTR3 ON ( OUTR2.pk > OUTR3.col_int_key ) ) -> -> ON ( OUTR1.col_int_nokey = OUTR2.col_int_key ) -> -> WHERE -> -> OUTR1.col_int_key IN ( SELECT DISTINCT INNR1.pk -> -> FROM CC AS INNR1 -> -> WHERE INNR1.col_int_nokey <= 1 OR NOT INNR1.pk > 4 -> -> UNION DISTINCT -> -> SELECT INNR1.pk -> -> FROM AA AS INNR1 -> -> GROUP BY INNR1.col_int_uniq -> -> HAVING COUNT(*) >= 2 -> -> ); +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ANALYZE | +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | { "query_optimization": { "r_total_time_ms": 0.583370762 }, "query_block": { "select_id": 1, "cost": 157.0381633, "r_loops": 1, "r_total_time_ms": 12.81715261, "nested_loop": [ { "table": { "table_name": "OUTR2", "access_type": "index", "possible_keys": ["PRIMARY"], "key": "k_int", "key_length": "5", "used_key_parts": ["col_int_key"], "loops": 1, "r_loops": 1, "rows": 100, "r_rows": 100, "cost": 0.02131442, "r_table_time_ms": 0.064732601, "r_other_time_ms": 0.068490267, "r_engine_stats": { "pages_accessed": 1 }, "filtered": 100, "r_total_filtered": 100, "r_filtered": 100, "using_index": true } }, { "table": { "table_name": "OUTR1", "access_type": "ALL", "loops": 100, "r_loops": 100, "rows": 100, "r_rows": 100, "cost": 2.6343792, "r_table_time_ms": 5.042948759, "r_other_time_ms": 2.367035117, "r_engine_stats": { "pages_accessed": 158, "pages_updated": 51 }, "filtered": 100, "r_total_filtered": 1.55, "attached_condition": "trigcond((OUTR1.col_int_key,(subquery#2))) and trigcond(OUTR1.col_int_nokey = OUTR2.col_int_key)", "r_filtered": 1.55 } }, { "range-checked-for-each-record": { "keys": ["k_int"], "r_keys": { "full_scan": 0, "index_merge": 0, "range": { "k_int": 96 } }, "table": { "table_name": "OUTR3", "access_type": "ALL", "possible_keys": ["k_int"], "loops": 10000, "r_loops": 96, "rows": 100, "r_rows": 78.09375, "cost": 154.3824696, "r_table_time_ms": 2.461141332, "r_other_time_ms": 2.388124071, "r_engine_stats": { "pages_accessed": 192 }, "filtered": 100, "r_total_filtered": 100, "r_filtered": 100 } } } ], "subqueries": [ { "query_block": { "union_result": { "table_name": "", "access_type": "ALL", "r_loops": 7, "r_rows": 0.285714286, "query_specifications": [ { "query_block": { "select_id": 2, "cost": 0.00171364, "r_loops": 7, "r_total_time_ms": 0.026521749, "nested_loop": [ { "table": { "table_name": "INNR1", "access_type": "eq_ref", "possible_keys": ["PRIMARY"], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["pk"], "ref": ["func"], "loops": 1, "r_loops": 7, "rows": 1, "r_rows": 1, "cost": 0.00171364, "r_table_time_ms": 0.014215845, "r_other_time_ms": 0.00629511, "r_engine_stats": { "pages_accessed": 7 }, "filtered": 100, "r_total_filtered": 14.28571429, "attached_condition": "INNR1.col_int_nokey <= 1 or INNR1.pk <= 4", "r_filtered": 14.28571429 } } ] } }, { "query_block": { "select_id": 3, "operation": "UNION", "cost": 0.02131442, "r_loops": 7, "r_total_time_ms": 0.337994582, "having_condition": "count(0) >= 2 and NULL = (INNR1.pk)", "nested_loop": [ { "table": { "table_name": "INNR1", "access_type": "index", "key": "u_int", "key_length": "5", "used_key_parts": ["col_int_uniq"], "loops": 1, "r_loops": 7, "rows": 100, "r_rows": 100, "cost": 0.02131442, "r_table_time_ms": 0.258957831, "r_other_time_ms": 0.074315083, "r_engine_stats": { "pages_accessed": 7 }, "filtered": 100, "r_total_filtered": 100, "r_filtered": 100, "using_index": true } } ] } } ] } } } ] } } | +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.016 sec) MariaDB [federated]> notee