MariaDB [dbt3]> explain format=json SELECT * FROM t JOIN nation ON (t.a = nation.n_nationkey) LEFT JOIN region ON ( r_regionkey = n_regionkey ) JOIN supplier ON ( s_nationkey = n_nationkey ) JOIN partsupp ON ( s_suppkey = ps_suppkey ) JOIN lineitem ON ( ps_partkey = l_partkey ) JOIN orders ON ( l_orderkey = o_orderkey ) JOIN customer WHERE o_totalprice = 151 OR c_nationkey = s_nationkey AND s_acctbal > 187\G *************************** 1. row *************************** EXPLAIN: { "query_block": { "select_id": 1, "nested_loop": [ { "table": { "table_name": "supplier", "access_type": "system", "possible_keys": ["PRIMARY"], "rows": 1, "filtered": 100 } }, { "table": { "table_name": "nation", "access_type": "const", "possible_keys": ["PRIMARY"], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["n_nationkey"], "ref": ["const"], "rows": 1, "filtered": 100 } }, { "table": { "table_name": "region", "access_type": "const", "possible_keys": ["PRIMARY"], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["r_regionkey"], "ref": ["const"], "rows": 1, "filtered": 100, "using_index": true } }, { "table": { "table_name": "lineitem", "access_type": "ALL", "possible_keys": ["PRIMARY"], "rows": 3, "filtered": 100, "attached_condition": "lineitem.l_partkey is not null" } }, { "table": { "table_name": "partsupp", "access_type": "eq_ref", "possible_keys": ["PRIMARY"], "key": "PRIMARY", "key_length": "8", "used_key_parts": ["ps_partkey", "ps_suppkey"], "ref": ["dbt3.lineitem.l_partkey", "const"], "rows": 1, "filtered": 100, "using_index": true } }, { "table": { "table_name": "orders", "access_type": "eq_ref", "possible_keys": ["PRIMARY"], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["o_orderkey"], "ref": ["dbt3.lineitem.l_orderkey"], "rows": 1, "filtered": 100 } }, { "table": { "table_name": "customer", "access_type": "index", "possible_keys": ["i_c_nationkey"], "key": "i_c_nationkey", "key_length": "5", "used_key_parts": ["c_nationkey"], "rows": 3, "filtered": 100, "attached_condition": "orders.o_totalprice = 151 or customer.c_nationkey = 17", "using_index": true } }, { "table": { "table_name": "t", "access_type": "ALL", "rows": 4, "filtered": 100, "attached_condition": "t.a = 17 and (orders.o_totalprice = 151 or customer.c_nationkey = 17 and t.a = 17)" } } ] } }