1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-27036: resolve duplicated key issues of JSON tracing outputs:

MDEV-27036: repeated "table" key resolve for print_explain_json

MDEV-27036: duplicated keys in best_access_path

MDEV-27036: Explain_aggr_filesort::print_json_members: resolve duplicated "filesort" member in Json object

MDEV-27036: Explain_basic_join::
            print_explain_json_interns fixed start_dups_weedout case for main.explain_json test
This commit is contained in:
Sergei Krivonos
2021-11-14 09:48:20 +02:00
committed by Sergei Krivonos
parent a01c82ef2e
commit 73df7a3009
39 changed files with 22848 additions and 17574 deletions

File diff suppressed because it is too large Load Diff

View File

@ -176,24 +176,30 @@ EXPLAIN
"filesort": {
"sort_key": "t2.b",
"temporary_table": {
"table": {
"table_name": "t0",
"access_type": "ALL",
"rows": 10,
"filtered": 100,
"attached_condition": "t0.a is not null"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["a"],
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
"rows": 1,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
"rows": 10,
"filtered": 100,
"attached_condition": "t0.a is not null"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["a"],
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
"rows": 1,
"filtered": 100
}
}
]
}
}
}
@ -215,34 +221,40 @@ ANALYZE
"r_output_rows": 4,
"r_sort_mode": "sort_key,rowid",
"temporary_table": {
"table": {
"table_name": "t0",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"attached_condition": "t0.a is not null"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["a"],
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
"r_loops": 10,
"rows": 1,
"r_rows": 0.4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"attached_condition": "t0.a is not null"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["a"],
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
"r_loops": 10,
"rows": 1,
"r_rows": 0.4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
}
}
@ -261,29 +273,35 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"read_sorted_file": {
"filesort": {
"sort_key": "t0.a",
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "t0.a",
"table": {
"table_name": "t0",
"access_type": "ALL",
"rows": 10,
"filtered": 100,
"attached_condition": "t0.a is not null"
}
}
}
},
{
"table": {
"table_name": "t0",
"access_type": "ALL",
"rows": 10,
"filtered": 100,
"attached_condition": "t0.a is not null"
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["a"],
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
"rows": 1,
"filtered": 100
}
}
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["a"],
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
"rows": 1,
"filtered": 100
}
]
}
}
analyze format=json
@ -294,46 +312,52 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"read_sorted_file": {
"r_rows": 10,
"filesort": {
"sort_key": "t0.a",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,addon_fields",
"table": {
"table_name": "t0",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 10,
"filesort": {
"sort_key": "t0.a",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,addon_fields",
"table": {
"table_name": "t0",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"attached_condition": "t0.a is not null"
}
}
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["a"],
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
"r_loops": 10,
"rows": 1,
"r_rows": 0.4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"attached_condition": "t0.a is not null"
"r_filtered": 100
}
}
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["a"],
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
"r_loops": 10,
"rows": 1,
"r_rows": 0.4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
]
}
}
drop table t2;
@ -365,18 +389,22 @@ ANALYZE
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,rowid",
"temporary_table": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 1000,
"r_rows": 1000,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 50,
"attached_condition": "t2.a MOD 2 = 0"
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 1000,
"r_rows": 1000,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 50,
"attached_condition": "t2.a MOD 2 = 0"
}
}
]
}
}
}
@ -414,35 +442,41 @@ ANALYZE
"r_total_time_ms": "REPLACED",
"duplicate_removal": {
"temporary_table": {
"table": {
"table_name": "t0",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL",
"attached_condition": "t3.a = t0.a",
"r_filtered": 10
}
{
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL",
"attached_condition": "t3.a = t0.a",
"r_filtered": 10
}
}
]
}
}
}
@ -488,36 +522,42 @@ ANALYZE
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,rowid",
"temporary_table": {
"table": {
"table_name": "t6",
"access_type": "ALL",
"r_loops": 1,
"rows": 5,
"r_rows": 5,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 80,
"attached_condition": "t6.b > 0 and t6.a <= 5"
},
"block-nl-join": {
"table": {
"table_name": "t5",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t6",
"access_type": "ALL",
"r_loops": 1,
"rows": 5,
"r_rows": 5,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 80,
"attached_condition": "t6.b > 0 and t6.a <= 5"
}
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"attached_condition": "t5.a = t6.a",
"r_filtered": 21.42857143
}
{
"block-nl-join": {
"table": {
"table_name": "t5",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"attached_condition": "t5.a = t6.a",
"r_filtered": 21.42857143
}
}
]
}
}
}
@ -538,25 +578,31 @@ EXPLAIN
"filesort": {
"sort_key": "t5.a",
"temporary_table": {
"table": {
"table_name": "t6",
"access_type": "ALL",
"rows": 5,
"filtered": 100,
"attached_condition": "t6.b > 0 and t6.a <= 5"
},
"block-nl-join": {
"table": {
"table_name": "t5",
"access_type": "ALL",
"rows": 7,
"filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t6",
"access_type": "ALL",
"rows": 5,
"filtered": 100,
"attached_condition": "t6.b > 0 and t6.a <= 5"
}
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"attached_condition": "t5.a = t6.a"
}
{
"block-nl-join": {
"table": {
"table_name": "t5",
"access_type": "ALL",
"rows": 7,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"attached_condition": "t5.a = t6.a"
}
}
]
}
}
}
@ -593,21 +639,25 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "range",
"key": "idx",
"key_length": "5",
"used_key_parts": ["col1"],
"r_loops": 1,
"rows": 7,
"r_rows": 20,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"using_index_for_group_by": true
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
"key": "idx",
"key_length": "5",
"used_key_parts": ["col1"],
"r_loops": 1,
"rows": 7,
"r_rows": 20,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"using_index_for_group_by": true
}
}
]
}
}
drop table t2;

View File

@ -261,17 +261,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
}
}
}
]
}
}
(select a from t1 order by a desc) limit 1;
@ -287,17 +291,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
}
}
}
]
}
}
(select a from t1 where a=20 union select a from t1) order by a desc limit 1;
@ -321,25 +329,33 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100,
"attached_condition": "t1.a = 20"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100,
"attached_condition": "t1.a = 20"
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "UNION",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
]
}
}
]
@ -367,25 +383,33 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100,
"attached_condition": "t1.a = 20"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100,
"attached_condition": "t1.a = 20"
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "UNION",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
]
}
}
]
@ -421,30 +445,38 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"read_sorted_file": {
"filesort": {
"sort_key": "t1.pk",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "t1.pk",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
}
}
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "UNION",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100,
"attached_condition": "t1.pk > 4"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100,
"attached_condition": "t1.pk > 4"
}
}
]
}
}
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -381,41 +381,51 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t2.f2 in (2,3) and t2.f2 is not null"
},
"table": {
"table_name": "<derived2>",
"access_type": "ref",
"possible_keys": ["key0"],
"key": "key0",
"key_length": "5",
"used_key_parts": ["f1"],
"ref": ["test.t2.f2"],
"rows": 2,
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 in (2,3)"
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t2.f2 in (2,3) and t2.f2 is not null"
}
},
{
"table": {
"table_name": "<derived2>",
"access_type": "ref",
"possible_keys": ["key0"],
"key": "key0",
"key_length": "5",
"used_key_parts": ["f1"],
"ref": ["test.t2.f2"],
"rows": 2,
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 in (2,3)"
}
}
]
}
}
}
}
}
}
}
]
}
}
select * from v1 join v4 on f1=f2;
@ -475,46 +485,58 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
"filesort": {
"sort_key": "tt.f1",
"temporary_table": {
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "tt.f1 > 2",
"materialized": {
"query_block": {
"select_id": 3,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2"
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
"filesort": {
"sort_key": "tt.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "tt.f1 > 2",
"materialized": {
"query_block": {
"select_id": 3,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2"
}
}
]
}
}
}
}
}
}
}
]
}
}
}
}
}
}
}
]
}
}
select * from (select * from
@ -544,58 +566,72 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "tt.f1 > 2 and tt.f1 > 2 and tt.f1 is not null",
"materialized": {
"query_block": {
"select_id": 3,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2 and t1.f1 > 2"
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "tt.f1 > 2 and tt.f1 > 2 and tt.f1 is not null",
"materialized": {
"query_block": {
"select_id": 3,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2 and t1.f1 > 2"
}
}
]
}
}
}
}
}
},
{
"table": {
"table_name": "<derived5>",
"access_type": "ref",
"possible_keys": ["key0"],
"key": "key0",
"key_length": "5",
"used_key_parts": ["f1"],
"ref": ["tt.f1"],
"rows": 2,
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 5,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2 and t1.f1 > 2"
}
}
]
}
}
}
}
}
}
},
"table": {
"table_name": "<derived5>",
"access_type": "ref",
"possible_keys": ["key0"],
"key": "key0",
"key_length": "5",
"used_key_parts": ["f1"],
"ref": ["tt.f1"],
"rows": 2,
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 5,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2 and t1.f1 > 2"
}
}
}
}
}
}
]
}
}
flush status;
@ -671,92 +707,114 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "x.f1 is not null",
"materialized": {
"query_block": {
"select_id": 2,
"filesort": {
"sort_key": "tt.f1",
"temporary_table": {
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "tt.f1 > 2",
"materialized": {
"query_block": {
"select_id": 3,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2"
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "x.f1 is not null",
"materialized": {
"query_block": {
"select_id": 2,
"filesort": {
"sort_key": "tt.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "tt.f1 > 2",
"materialized": {
"query_block": {
"select_id": 3,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2"
}
}
]
}
}
}
}
}
}
}
]
}
}
}
}
}
},
{
"table": {
"table_name": "<derived4>",
"access_type": "ref",
"possible_keys": ["key0"],
"key": "key0",
"key_length": "5",
"used_key_parts": ["f1"],
"ref": ["x.f1"],
"rows": 2,
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 4,
"filesort": {
"sort_key": "tt.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "<derived5>",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "tt.f1 > 2",
"materialized": {
"query_block": {
"select_id": 5,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2"
}
}
]
}
}
}
}
}
}
]
}
}
}
}
}
}
},
"table": {
"table_name": "<derived4>",
"access_type": "ref",
"possible_keys": ["key0"],
"key": "key0",
"key_length": "5",
"used_key_parts": ["f1"],
"ref": ["x.f1"],
"rows": 2,
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 4,
"filesort": {
"sort_key": "tt.f1",
"temporary_table": {
"table": {
"table_name": "<derived5>",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "tt.f1 > 2",
"materialized": {
"query_block": {
"select_id": 5,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2"
}
}
}
}
}
}
}
}
}
}
}
]
}
}
select * from
@ -795,30 +853,38 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "v1.f1 < 7",
"materialized": {
"query_block": {
"select_id": 3,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 < 7"
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "v1.f1 < 7",
"materialized": {
"query_block": {
"select_id": 3,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 < 7"
}
}
]
}
}
}
}
}
}
}
]
}
}
select * from ( select * from v1 where f1 < 7) tt;
@ -873,41 +939,51 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t2.f2 < 7 and t2.f2 in (2,3) and t2.f2 is not null"
},
"table": {
"table_name": "<derived5>",
"access_type": "ref",
"possible_keys": ["key0"],
"key": "key0",
"key_length": "5",
"used_key_parts": ["f1"],
"ref": ["test.t2.f2"],
"rows": 2,
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 5,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 in (2,3)"
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t2.f2 < 7 and t2.f2 in (2,3) and t2.f2 is not null"
}
},
{
"table": {
"table_name": "<derived5>",
"access_type": "ref",
"possible_keys": ["key0"],
"key": "key0",
"key_length": "5",
"used_key_parts": ["f1"],
"ref": ["test.t2.f2"],
"rows": 2,
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 5,
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 in (2,3)"
}
}
]
}
}
}
}
}
}
}
]
}
}
select * from v6 join v7 on f2=f1;

View File

@ -37,24 +37,32 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "EXCEPT",
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
}
]
}
}
]
@ -76,17 +84,21 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
@ -95,17 +107,21 @@ ANALYZE
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
}
]
@ -119,66 +135,78 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 1,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<except2,3>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 1,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 1,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<except2,3>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 1,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
}
}
},
{
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
]
}
}
}
}
}
]
}
}
select * from ((select a,b from t1) except (select c,d from t2)) a;
@ -247,46 +275,58 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 2,
"filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL"
}
{
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 2,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL"
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "EXCEPT",
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 2,
"filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t4",
"access_type": "ALL",
"rows": 2,
"filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL"
}
{
"block-nl-join": {
"table": {
"table_name": "t4",
"access_type": "ALL",
"rows": 2,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL"
}
}
]
}
}
]
@ -308,34 +348,40 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
}
{
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
}
}
]
}
},
{
@ -344,34 +390,40 @@ ANALYZE
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t4",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
}
{
"block-nl-join": {
"table": {
"table_name": "t4",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
}
}
]
}
}
]
@ -386,100 +438,116 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<except2,3>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 3,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<except2,3>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 3,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
}
}
},
{
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
}
}
]
}
},
"block-nl-join": {
"table": {
"table_name": "t4",
"access_type": "ALL",
{
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t4",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
}
}
]
}
}
}
]
}
]
}
}
}
}
}
]
}
}
select * from ((select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4)) a;

View File

@ -65,24 +65,32 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 7,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 7,
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "EXCEPT",
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 7,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 7,
"filtered": 100
}
}
]
}
}
]
@ -111,66 +119,78 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<except2,3>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 4,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<except2,3>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 4,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
}
}
},
{
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
]
}
}
}
}
}
]
}
}
ANALYZE format=json select * from ((select a from t1) except all (select c from t2)) a;
@ -180,66 +200,78 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<except2,3>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 4,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<except2,3>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 4,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
}
}
},
{
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
]
}
}
}
}
}
]
}
}
select * from ((select a from t1) except all (select c from t2)) a;
@ -349,67 +381,83 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 9,
"filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<except2,3>",
"access_type": "ALL",
"query_specifications": [
{
"query_block": {
"select_id": 2,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 9,
"filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<except2,3>",
"access_type": "ALL",
"query_specifications": [
{
"query_block": {
"select_id": 2,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 3,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL"
}
}
]
}
},
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 3,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL"
{
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t4",
"access_type": "ALL",
"rows": 3,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL"
}
}
]
}
}
}
},
{
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 2,
"filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t4",
"access_type": "ALL",
"rows": 3,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL"
}
}
]
}
]
}
}
}
}
}
]
}
}
ANALYZE format=json (select a,b,e,f from t1,t3) except all (select c,d,g,h from t2,t4);
@ -427,34 +475,40 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
}
{
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
}
}
]
}
},
{
@ -463,34 +517,40 @@ ANALYZE
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t4",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
}
{
"block-nl-join": {
"table": {
"table_name": "t4",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
}
}
]
}
}
]
@ -504,100 +564,116 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 9,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<except2,3>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 7,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 9,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<except2,3>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 7,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
}
}
},
{
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
}
}
]
}
},
"block-nl-join": {
"table": {
"table_name": "t4",
"access_type": "ALL",
{
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t4",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
"r_filtered": 100
}
}
]
}
}
}
]
}
]
}
}
}
}
}
]
}
}
prepare stmt from "(select a,b,e,f from t1,t3) except all (select c,d,g,h from t2,t4)";

File diff suppressed because it is too large Load Diff

View File

@ -12,14 +12,18 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"partitions": ["p0"],
"access_type": "ALL",
"rows": 10,
"filtered": 100,
"attached_condition": "t1.a in (2,3,4)"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"partitions": ["p0"],
"access_type": "ALL",
"rows": 10,
"filtered": 100,
"attached_condition": "t1.a in (2,3,4)"
}
}
]
}
}
analyze format=json select * from t1 where a in (2,3,4);
@ -29,19 +33,23 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"partitions": ["p0"],
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 30,
"attached_condition": "t1.a in (2,3,4)"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"partitions": ["p0"],
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 30,
"attached_condition": "t1.a in (2,3,4)"
}
}
]
}
}
analyze format=json update t1 set a=a+10 where a in (2,3,4);

View File

@ -16,39 +16,49 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100
},
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
}
],
"subqueries": [
{
"query_block": {
"select_id": 2,
"table": {
"table_name": "tbl_alias1",
"access_type": "ALL",
"rows": 1,
"filtered": 100,
"attached_condition": "tbl_alias1.column_name_2 is not null and tbl_alias1.column_name_1 is not null"
},
"table": {
"table_name": "tbl_alias2",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "9",
"used_key_parts": ["c", "b"],
"ref": [
"test.tbl_alias1.column_name_2",
"test.tbl_alias1.column_name_1"
],
"rows": 1,
"filtered": 100,
"attached_condition": "tbl_alias2.c = tbl_alias1.column_name_2",
"using_index": true
}
"nested_loop": [
{
"table": {
"table_name": "tbl_alias1",
"access_type": "ALL",
"rows": 1,
"filtered": 100,
"attached_condition": "tbl_alias1.column_name_2 is not null and tbl_alias1.column_name_1 is not null"
}
},
{
"table": {
"table_name": "tbl_alias2",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "9",
"used_key_parts": ["c", "b"],
"ref": [
"test.tbl_alias1.column_name_2",
"test.tbl_alias1.column_name_1"
],
"rows": 1,
"filtered": 100,
"attached_condition": "tbl_alias2.c = tbl_alias1.column_name_2",
"using_index": true
}
}
]
}
}
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -265,30 +265,30 @@
drop table t0,t1,t2;
#
# MDEV-11196: Error:Run-Time Check Failure #2 - Stack around the variable 'key_buff'
@@ -755,11 +755,12 @@
"select_id": 1,
"table": {
"table_name": "t1",
- "access_type": "range",
+ "access_type": "ref",
"possible_keys": ["f2"],
"key": "f2",
- "key_length": "3070",
- "used_key_parts": ["f2", "pk1"],
+ "key_length": "3066",
+ "used_key_parts": ["f2"],
+ "ref": ["const"],
"rows": 1,
"filtered": 100,
"index_condition": "t1.pk1 <= 5 and t1.pk2 <= 5 and t1.f2 = 'abc'",
@@ -788,8 +789,8 @@
"access_type": "range",
"possible_keys": ["k1"],
"key": "k1",
- "key_length": "3011",
- "used_key_parts": ["pk1", "f2", "pk2"],
+ "key_length": "3007",
+ "used_key_parts": ["pk1", "f2"],
"rows": 1,
"filtered": 100,
"index_condition": "t1.f2 <= 5 and t1.pk2 <= 5 and t1.pk1 = 'abc'",
@@ -768,11 +768,12 @@
{
"table": {
"table_name": "t1",
- "access_type": "range",
+ "access_type": "ref",
"possible_keys": ["f2"],
"key": "f2",
- "key_length": "3070",
- "used_key_parts": ["f2", "pk1"],
+ "key_length": "3066",
+ "used_key_parts": ["f2"],
+ "ref": ["const"],
"rows": 1,
"filtered": 100,
"index_condition": "t1.pk1 <= 5 and t1.pk2 <= 5 and t1.f2 = 'abc'",
@@ -805,8 +806,8 @@
"access_type": "range",
"possible_keys": ["k1"],
"key": "k1",
- "key_length": "3011",
- "used_key_parts": ["pk1", "f2", "pk2"],
+ "key_length": "3007",
+ "used_key_parts": ["pk1", "f2"],
"rows": 1,
"filtered": 100,
"index_condition": "t1.f2 <= 5 and t1.pk2 <= 5 and t1.pk1 = 'abc'",

View File

@ -764,18 +764,22 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["f2"],
"key": "f2",
"key_length": "3070",
"used_key_parts": ["f2", "pk1"],
"rows": 1,
"filtered": 100,
"index_condition": "t1.pk1 <= 5 and t1.pk2 <= 5 and t1.f2 = 'abc'",
"attached_condition": "t1.f1 <= '3'"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["f2"],
"key": "f2",
"key_length": "3070",
"used_key_parts": ["f2", "pk1"],
"rows": 1,
"filtered": 100,
"index_condition": "t1.pk1 <= 5 and t1.pk2 <= 5 and t1.f2 = 'abc'",
"attached_condition": "t1.f1 <= '3'"
}
}
]
}
}
drop table t1;
@ -794,18 +798,22 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["k1"],
"key": "k1",
"key_length": "3011",
"used_key_parts": ["pk1", "f2", "pk2"],
"rows": 1,
"filtered": 100,
"index_condition": "t1.f2 <= 5 and t1.pk2 <= 5 and t1.pk1 = 'abc'",
"attached_condition": "t1.f1 <= '3'"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["k1"],
"key": "k1",
"key_length": "3011",
"used_key_parts": ["pk1", "f2", "pk2"],
"rows": 1,
"filtered": 100,
"index_condition": "t1.f2 <= 5 and t1.pk2 <= 5 and t1.pk1 = 'abc'",
"attached_condition": "t1.f1 <= '3'"
}
}
]
}
}
drop table t1;

View File

@ -51,36 +51,48 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
]
}
}
]
@ -102,17 +114,21 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
@ -121,17 +137,21 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
@ -140,17 +160,21 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
}
]
@ -164,85 +188,101 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 1,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<intersect2,3,4>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 1,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 1,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<intersect2,3,4>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 1,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 4,
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
}
}
},
{
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
},
{
"query_block": {
"select_id": 4,
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
]
}
}
}
}
}
]
}
}
select * from ((select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3)) a;
@ -300,35 +340,45 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 3,
"filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 3,
"filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
},
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL"
}
{
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 3,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL"
}
}
]
}
}
]
@ -350,17 +400,21 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
@ -369,34 +423,40 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL",
"r_filtered": 100
}
{
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL",
"r_filtered": 100
}
}
]
}
}
]
@ -410,83 +470,97 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 1,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<intersect2,3>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 1,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
},
{
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 1,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<intersect2,3>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 1,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL",
"r_filtered": 100
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL",
"r_filtered": 100
}
}
]
}
}
}
]
}
]
}
}
}
}
}
]
}
}
set @@optimizer_switch=@save_optimizer_switch;

View File

@ -63,36 +63,48 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 4,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 4,
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 4,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 4,
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 4,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 4,
"filtered": 100
}
}
]
}
}
]
@ -114,17 +126,21 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
@ -133,17 +149,21 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
@ -152,17 +172,21 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
}
]
@ -176,85 +200,101 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<intersect2,3,4>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 2,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 2,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<intersect2,3,4>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 2,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 4,
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
}
}
},
{
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
},
{
"query_block": {
"select_id": 4,
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
]
}
}
}
}
}
]
}
}
select * from ((select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3)) a;
@ -331,35 +371,45 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 6,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 6,
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 5,
"filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 7,
"filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
},
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL"
}
{
"block-nl-join": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 7,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL"
}
}
]
}
}
]
@ -381,17 +431,21 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 6,
"r_rows": 6,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 6,
"r_rows": 6,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
@ -400,34 +454,40 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 5,
"r_rows": 5,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 5,
"r_rows": 5,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL",
"r_filtered": 100
}
{
"block-nl-join": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL",
"r_filtered": 100
}
}
]
}
}
]
@ -441,83 +501,97 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 6,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<intersect2,3>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 3,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 6,
"r_rows": 6,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
},
{
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 5,
"r_rows": 5,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 6,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<intersect2,3>",
"access_type": "ALL",
"r_loops": 1,
"r_rows": 3,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL",
"r_filtered": 100
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 6,
"r_rows": 6,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 5,
"r_rows": 5,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL",
"r_filtered": 100
}
}
]
}
}
}
]
}
]
}
}
}
}
}
]
}
}
select * from ((select a,b from t1) intersect all (select c,e from t2,t3)) a;

View File

@ -6195,36 +6195,42 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "a",
"access_type": "range",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["a"],
"rows": 10,
"filtered": 100,
"attached_condition": "a.a <= 10",
"using_index": true
},
"block-nl-join": {
"table": {
"table_name": "b",
"access_type": "range",
"possible_keys": ["kp1"],
"key": "kp1",
"key_length": "10",
"used_key_parts": ["kp1", "kp2"],
"rows": 836,
"filtered": 76.43428802,
"index_condition": "b.kp2 <= 10",
"attached_condition": "b.kp2 <= 10 and b.col1 + 1 < 33333"
"nested_loop": [
{
"table": {
"table_name": "a",
"access_type": "range",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["a"],
"rows": 10,
"filtered": 100,
"attached_condition": "a.a <= 10",
"using_index": true
}
},
"buffer_type": "flat",
"buffer_size": "54",
"join_type": "BNL",
"attached_condition": "b.kp1 = a.a"
}
{
"block-nl-join": {
"table": {
"table_name": "b",
"access_type": "range",
"possible_keys": ["kp1"],
"key": "kp1",
"key_length": "10",
"used_key_parts": ["kp1", "kp2"],
"rows": 836,
"filtered": 76.43428802,
"index_condition": "b.kp2 <= 10",
"attached_condition": "b.kp2 <= 10 and b.col1 + 1 < 33333"
},
"buffer_type": "flat",
"buffer_size": "54",
"join_type": "BNL",
"attached_condition": "b.kp1 = a.a"
}
}
]
}
}
drop table t1,t2,t3;

View File

@ -1028,7 +1028,7 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
"access_type": "ref",
"index": "a",
"used_range_estimates": false,
"cause": "not available",
"reason": "not available",
"rows": 1,
"cost": 200.0585794,
"chosen": true
@ -1084,7 +1084,7 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
"access_type": "ref",
"index": "a",
"used_range_estimates": false,
"cause": "not available",
"reason": "not available",
"rows": 1,
"cost": 200.0585794,
"chosen": true
@ -4042,7 +4042,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"access_type": "ref",
"index": "a",
"used_range_estimates": false,
"cause": "not better than ref estimates",
"reason": "not better than ref estimates",
"rows": 1,
"cost": 3.001757383,
"chosen": true
@ -4098,7 +4098,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"index": "a",
"rec_per_key_stats_missing": true,
"used_range_estimates": false,
"cause": "not better than ref estimates",
"reason": "not better than ref estimates",
"rows": 2,
"cost": 3.003514767,
"chosen": true
@ -7980,17 +7980,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["start_date"],
"key": "start_date",
"key_length": "8",
"used_key_parts": ["start_date", "end_date"],
"rows": 1000,
"filtered": 100,
"index_condition": "t1.start_date >= '2019-02-10' and t1.end_date < '2019-04-01'"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["start_date"],
"key": "start_date",
"key_length": "8",
"used_key_parts": ["start_date", "end_date"],
"rows": 1000,
"filtered": 100,
"index_condition": "t1.start_date >= '2019-02-10' and t1.end_date < '2019-04-01'"
}
}
]
}
}
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
@ -8214,7 +8218,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
"access_type": "ref",
"index": "b",
"used_range_estimates": false,
"cause": "not available",
"reason": "not available",
"rows": 1,
"cost": 20.00585794,
"chosen": true
@ -8438,7 +8442,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
"access_type": "ref",
"index": "a",
"used_range_estimates": false,
"cause": "not available",
"reason": "not available",
"rows": 1,
"cost": 20.00585794,
"chosen": true
@ -8513,7 +8517,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
"access_type": "ref",
"index": "a",
"used_range_estimates": false,
"cause": "not available",
"reason": "not available",
"rows": 1,
"cost": 200.0585794,
"chosen": true
@ -9167,7 +9171,7 @@ json_detailed(json_extract(trace, '$**.choose_best_splitting'))
"access_type": "ref",
"index": "idx_a",
"used_range_estimates": false,
"cause": "not available",
"reason": "not available",
"rows": 1.8367,
"cost": 2.000585794,
"chosen": true

View File

@ -7,17 +7,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["col1"],
"key": "col1",
"key_length": "21",
"used_key_parts": ["col1"],
"rows": 2,
"filtered": 100,
"index_condition": "t1.col1 >= 'a'"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["col1"],
"key": "col1",
"key_length": "21",
"used_key_parts": ["col1"],
"rows": 2,
"filtered": 100,
"index_condition": "t1.col1 >= 'a'"
}
}
]
}
}
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;

View File

@ -3401,30 +3401,34 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"read_sorted_file": {
"r_rows": 5,
"filesort": {
"sort_key": "t1.a",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_limit": 5,
"r_used_priority_queue": false,
"r_output_rows": 100,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,packed_addon_fields",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 100,
"r_rows": 100,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 5,
"filesort": {
"sort_key": "t1.a",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_limit": 5,
"r_used_priority_queue": false,
"r_output_rows": 100,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,packed_addon_fields",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 100,
"r_rows": 100,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
}
}
}
]
}
}
SELECT * FROM t1 ORDER BY a LIMIT 5;
@ -3708,29 +3712,33 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"read_sorted_file": {
"r_rows": 100,
"filesort": {
"sort_key": "t1.a, t1.b, t1.c",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 100,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,packed_addon_fields",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 100,
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 100,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"filesort": {
"sort_key": "t1.a, t1.b, t1.c",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 100,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,packed_addon_fields",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 100,
"r_rows": 100,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
}
}
}
]
}
}
select * from t1 order by a,b,c;
@ -3867,29 +3875,33 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"read_sorted_file": {
"r_rows": 5,
"filesort": {
"sort_key": "t1.b desc",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 5,
"r_buffer_size": "REPLACED",
"r_sort_mode": "packed_sort_key,rowid",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 5,
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 5,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"filesort": {
"sort_key": "t1.b desc",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 5,
"r_buffer_size": "REPLACED",
"r_sort_mode": "packed_sort_key,rowid",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 5,
"r_rows": 5,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
}
}
}
]
}
}
drop table t1;
@ -3909,29 +3921,33 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"read_sorted_file": {
"r_rows": 6,
"filesort": {
"sort_key": "t1.a, t1.b",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 6,
"r_buffer_size": "REPLACED",
"r_sort_mode": "packed_sort_key,rowid",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 6,
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 6,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"filesort": {
"sort_key": "t1.a, t1.b",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 6,
"r_buffer_size": "REPLACED",
"r_sort_mode": "packed_sort_key,rowid",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 6,
"r_rows": 6,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
}
}
}
]
}
}
select a, b, c from t1 order by a, b;
@ -3957,29 +3973,33 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"read_sorted_file": {
"r_rows": 6,
"filesort": {
"sort_key": "t1.a, t1.b",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 6,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,packed_addon_fields",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 6,
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 6,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"filesort": {
"sort_key": "t1.a, t1.b",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 6,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,packed_addon_fields",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 6,
"r_rows": 6,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
}
}
}
]
}
}
select a, b, c from t1 order by a, b;
@ -4019,29 +4039,33 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"read_sorted_file": {
"r_rows": 10,
"filesort": {
"sort_key": "t1.a",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10,
"r_buffer_size": "REPLACED",
"r_sort_mode": "packed_sort_key,packed_addon_fields",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"filesort": {
"sort_key": "t1.a",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10,
"r_buffer_size": "REPLACED",
"r_sort_mode": "packed_sort_key,packed_addon_fields",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
}
}
}
]
}
}
drop table t1;
@ -4194,17 +4218,21 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 50,
"r_rows": 50,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 50,
"r_rows": 50,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
],
"subqueries": [
{
"expression_cache": {
@ -4223,18 +4251,22 @@ ANALYZE
"r_buffer_size": "REPLACED" across executions)",
"r_sort_mode": "sort_key,rowid",
"temporary_table": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 50,
"rows": 50,
"r_rows": 50,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 2,
"attached_condition": "t1.b = t2.b"
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 50,
"rows": 50,
"r_rows": 50,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 2,
"attached_condition": "t1.b = t2.b"
}
}
]
}
}
}
@ -4324,43 +4356,53 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc",
"table": {
"table_name": "<subquery2>",
"access_type": "ALL",
"possible_keys": ["distinct_key"],
"rows": 3,
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 3,
"filtered": 100,
"attached_condition": "t2.b = 3 and t2.a is not null"
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc",
"table": {
"table_name": "<subquery2>",
"access_type": "ALL",
"possible_keys": ["distinct_key"],
"rows": 3,
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 3,
"filtered": 100,
"attached_condition": "t2.b = 3 and t2.a is not null"
}
}
]
}
}
}
}
}
},
{
"table": {
"table_name": "t1",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
"rows": 1,
"filtered": 100,
"using_index": true
}
}
},
"table": {
"table_name": "t1",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
"rows": 1,
"filtered": 100,
"using_index": true
}
]
}
}
SELECT t1.a
@ -4387,42 +4429,52 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc",
"table": {
"table_name": "<subquery2>",
"access_type": "ALL",
"possible_keys": ["distinct_key"],
"rows": 3,
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 3,
"filtered": 100,
"attached_condition": "t2.b = 3 and t2.a is not null"
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc",
"table": {
"table_name": "<subquery2>",
"access_type": "ALL",
"possible_keys": ["distinct_key"],
"rows": 3,
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 3,
"filtered": 100,
"attached_condition": "t2.b = 3 and t2.a is not null"
}
}
]
}
}
}
}
}
},
{
"table": {
"table_name": "t1",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
"rows": 1,
"filtered": 100
}
}
},
"table": {
"table_name": "t1",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
"rows": 1,
"filtered": 100
}
]
}
}
SELECT t1.a, group_concat(t1.b)

View File

@ -93,29 +93,33 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"read_sorted_file": {
"r_rows": 10000,
"filesort": {
"sort_key": "t3.`id` DIV 100",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10000,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,packed_addon_fields",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 10000,
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 10000,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"filesort": {
"sort_key": "t3.`id` DIV 100",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10000,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,packed_addon_fields",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 10000,
"r_rows": 10000,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
}
}
}
]
}
}
flush status;
@ -250,30 +254,34 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"read_sorted_file": {
"r_rows": 10000,
"filesort": {
"sort_key": "t3.`id` DIV 100",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10000,
"r_sort_passes": 4,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,packed_addon_fields",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 10000,
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 10000,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"filesort": {
"sort_key": "t3.`id` DIV 100",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10000,
"r_sort_passes": 4,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,packed_addon_fields",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 10000,
"r_rows": 10000,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
}
}
}
]
}
}
flush status;
@ -405,29 +413,33 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"read_sorted_file": {
"r_rows": 10000,
"filesort": {
"sort_key": "t3.`names`, t3.address",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10000,
"r_buffer_size": "REPLACED",
"r_sort_mode": "packed_sort_key,packed_addon_fields",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 10000,
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 10000,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"filesort": {
"sort_key": "t3.`names`, t3.address",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10000,
"r_buffer_size": "REPLACED",
"r_sort_mode": "packed_sort_key,packed_addon_fields",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 10000,
"r_rows": 10000,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
}
}
}
]
}
}
flush status;
@ -454,29 +466,33 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"read_sorted_file": {
"r_rows": 10000,
"filesort": {
"sort_key": "t3.`names`, t3.address",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10000,
"r_buffer_size": "REPLACED",
"r_sort_mode": "packed_sort_key,rowid",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 10000,
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 10000,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
"filesort": {
"sort_key": "t3.`names`, t3.address",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10000,
"r_buffer_size": "REPLACED",
"r_sort_mode": "packed_sort_key,rowid",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 10000,
"r_rows": 10000,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
}
}
}
]
}
}
flush status;

View File

@ -2412,17 +2412,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "10",
"used_key_parts": ["a", "b"],
"rows": 6,
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in (<cache>((2,3)),<cache>((3,3)),<cache>((8,8)),<cache>((7,7)))"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "10",
"used_key_parts": ["a", "b"],
"rows": 6,
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in (<cache>((2,3)),<cache>((3,3)),<cache>((8,8)),<cache>((7,7)))"
}
}
]
}
}
select * from t1 where (a,b) IN ((2, 3),(3,3),(8,8),(7,7));
@ -2472,17 +2476,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 5,
"filtered": 100,
"attached_condition": "(t1.a,t1.b + t1.a) in (<cache>((4,9)),<cache>((8,8)),<cache>((7,7)))"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 5,
"filtered": 100,
"attached_condition": "(t1.a,t1.b + t1.a) in (<cache>((4,9)),<cache>((8,8)),<cache>((7,7)))"
}
}
]
}
}
select * from t1 where (a,b+a) IN ((4,9),(8,8),(7,7));
@ -2498,17 +2506,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 5,
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in ((4,t1.a - 1),(8,t1.a + 8),(7,t1.a + 7))"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 5,
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in ((4,t1.a - 1),(8,t1.a + 8),(7,t1.a + 7))"
}
}
]
}
}
select * from t1 where (a,b) IN ((4,a-1),(8,a+8),(7,a+7));
@ -2538,37 +2550,43 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"rowid_filter": {
"range": {
"key": "idx2",
"used_key_parts": ["e"]
},
"rows": 12,
"selectivity_pct": 60
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"rowid_filter": {
"range": {
"key": "idx2",
"used_key_parts": ["e"]
},
"rows": 12,
"selectivity_pct": 60
},
"rows": 3,
"filtered": 60,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((2,2)))"
}
},
"rows": 3,
"filtered": 60,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((2,2)))"
},
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 8,
"filtered": 100
}
{
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 8,
"filtered": 100
}
}
]
}
}
select * from t1,t2
@ -2618,37 +2636,43 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"rowid_filter": {
"range": {
"key": "idx2",
"used_key_parts": ["e"]
},
"rows": 15,
"selectivity_pct": 14.42307692
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"rowid_filter": {
"range": {
"key": "idx2",
"used_key_parts": ["e"]
},
"rows": 15,
"selectivity_pct": 14.42307692
},
"rows": 8,
"filtered": 14.42307663,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
}
},
"rows": 8,
"filtered": 14.42307663,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
},
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 8,
"filtered": 100
}
{
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 8,
"filtered": 100
}
}
]
}
}
select * from t1,t2
@ -2723,37 +2747,43 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"rowid_filter": {
"range": {
"key": "idx2",
"used_key_parts": ["e"]
},
"rows": 7,
"selectivity_pct": 6.730769231
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"rowid_filter": {
"range": {
"key": "idx2",
"used_key_parts": ["e"]
},
"rows": 7,
"selectivity_pct": 6.730769231
},
"rows": 7,
"filtered": 6.730769157,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
}
},
"rows": 7,
"filtered": 6.730769157,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
},
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 11,
"filtered": 100
}
{
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 11,
"filtered": 100
}
}
]
}
}
select * from t1,t2
@ -2781,29 +2811,35 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "10",
"used_key_parts": ["d", "e"],
"rows": 5,
"filtered": 100,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
},
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 11,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "10",
"used_key_parts": ["d", "e"],
"rows": 5,
"filtered": 100,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
}
},
{
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 11,
"filtered": 100
}
}
]
}
}
select * from t1,t2
@ -2830,29 +2866,35 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 15,
"filtered": 100,
"index_condition": "t1.a is not null"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((4,t1.a + 1),(7,t1.a + 1),(8,t1.a + 1)) and octet_length(t2.f) = 1"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 15,
"filtered": 100,
"index_condition": "t1.a is not null"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((4,t1.a + 1),(7,t1.a + 1),(8,t1.a + 1)) and octet_length(t2.f) = 1"
}
}
]
}
}
select * from t1,t2
@ -2887,26 +2929,32 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"possible_keys": ["idx"],
"rows": 144,
"filtered": 100,
"attached_condition": "t1.a is not null"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((t2.e,t1.a + 1),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"possible_keys": ["idx"],
"rows": 144,
"filtered": 100,
"attached_condition": "t1.a is not null"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((t2.e,t1.a + 1),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
}
}
]
}
}
select * from t1,t2
@ -2935,30 +2983,36 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 12,
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,2) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "octet_length(t2.f) = 1"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 12,
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,2) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "octet_length(t2.f) = 1"
}
}
]
}
}
select * from t1,t2
@ -3012,41 +3066,49 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t3",
"access_type": "const",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["id"],
"ref": ["const"],
"rows": 1,
"filtered": 100
},
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 12,
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,1 + 1) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "octet_length(t2.f) = 1"
}
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "const",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["id"],
"ref": ["const"],
"rows": 1,
"filtered": 100
}
},
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 12,
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,1 + 1) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "octet_length(t2.f) = 1"
}
}
]
}
}
select * from t1,t2,t3

View File

@ -2415,18 +2415,22 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "10",
"used_key_parts": ["a", "b"],
"rows": 6,
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in (<cache>((2,3)),<cache>((3,3)),<cache>((8,8)),<cache>((7,7)))",
"mrr_type": "Rowid-ordered scan"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "10",
"used_key_parts": ["a", "b"],
"rows": 6,
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in (<cache>((2,3)),<cache>((3,3)),<cache>((8,8)),<cache>((7,7)))",
"mrr_type": "Rowid-ordered scan"
}
}
]
}
}
select * from t1 where (a,b) IN ((2, 3),(3,3),(8,8),(7,7));
@ -2476,18 +2480,22 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 5,
"filtered": 100,
"attached_condition": "(t1.a,t1.b + t1.a) in (<cache>((4,9)),<cache>((8,8)),<cache>((7,7)))",
"mrr_type": "Rowid-ordered scan"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 5,
"filtered": 100,
"attached_condition": "(t1.a,t1.b + t1.a) in (<cache>((4,9)),<cache>((8,8)),<cache>((7,7)))",
"mrr_type": "Rowid-ordered scan"
}
}
]
}
}
select * from t1 where (a,b+a) IN ((4,9),(8,8),(7,7));
@ -2503,18 +2511,22 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 5,
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in ((4,t1.a - 1),(8,t1.a + 8),(7,t1.a + 7))",
"mrr_type": "Rowid-ordered scan"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 5,
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in ((4,t1.a - 1),(8,t1.a + 8),(7,t1.a + 7))",
"mrr_type": "Rowid-ordered scan"
}
}
]
}
}
select * from t1 where (a,b) IN ((4,a-1),(8,a+8),(7,a+7));
@ -2544,30 +2556,36 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"rows": 3,
"filtered": 60,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((2,2)))",
"mrr_type": "Rowid-ordered scan"
},
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 8,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"rows": 3,
"filtered": 60,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((2,2)))",
"mrr_type": "Rowid-ordered scan"
}
},
{
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 8,
"filtered": 100
}
}
]
}
}
select * from t1,t2
@ -2617,30 +2635,36 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"rows": 8,
"filtered": 14.42307663,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1",
"mrr_type": "Rowid-ordered scan"
},
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 8,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"rows": 8,
"filtered": 14.42307663,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1",
"mrr_type": "Rowid-ordered scan"
}
},
{
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 8,
"filtered": 100
}
}
]
}
}
select * from t1,t2
@ -2715,30 +2739,36 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"rows": 7,
"filtered": 6.730769157,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1",
"mrr_type": "Rowid-ordered scan"
},
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 11,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"rows": 7,
"filtered": 6.730769157,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1",
"mrr_type": "Rowid-ordered scan"
}
},
{
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 11,
"filtered": 100
}
}
]
}
}
select * from t1,t2
@ -2766,30 +2796,36 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "10",
"used_key_parts": ["d", "e"],
"rows": 5,
"filtered": 100,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1",
"mrr_type": "Rowid-ordered scan"
},
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 11,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "10",
"used_key_parts": ["d", "e"],
"rows": 5,
"filtered": 100,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1",
"mrr_type": "Rowid-ordered scan"
}
},
{
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 11,
"filtered": 100
}
}
]
}
}
select * from t1,t2
@ -2816,30 +2852,36 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 15,
"filtered": 100,
"index_condition": "t1.a is not null",
"mrr_type": "Rowid-ordered scan"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((4,t1.a + 1),(7,t1.a + 1),(8,t1.a + 1)) and octet_length(t2.f) = 1"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 15,
"filtered": 100,
"index_condition": "t1.a is not null",
"mrr_type": "Rowid-ordered scan"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((4,t1.a + 1),(7,t1.a + 1),(8,t1.a + 1)) and octet_length(t2.f) = 1"
}
}
]
}
}
select * from t1,t2
@ -2874,26 +2916,32 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"possible_keys": ["idx"],
"rows": 144,
"filtered": 100,
"attached_condition": "t1.a is not null"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((t2.e,t1.a + 1),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"possible_keys": ["idx"],
"rows": 144,
"filtered": 100,
"attached_condition": "t1.a is not null"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((t2.e,t1.a + 1),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
}
}
]
}
}
select * from t1,t2
@ -2922,31 +2970,37 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 12,
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,2) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1",
"mrr_type": "Rowid-ordered scan"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "octet_length(t2.f) = 1"
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 12,
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,2) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1",
"mrr_type": "Rowid-ordered scan"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "octet_length(t2.f) = 1"
}
}
]
}
}
select * from t1,t2
@ -3000,42 +3054,50 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t3",
"access_type": "const",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["id"],
"ref": ["const"],
"rows": 1,
"filtered": 100
},
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 12,
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,1 + 1) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1",
"mrr_type": "Rowid-ordered scan"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "octet_length(t2.f) = 1"
}
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "const",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["id"],
"ref": ["const"],
"rows": 1,
"filtered": 100
}
},
{
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 12,
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,1 + 1) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1",
"mrr_type": "Rowid-ordered scan"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "octet_length(t2.f) = 1"
}
}
]
}
}
select * from t1,t2,t3

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -571,194 +571,246 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 8,
"operation": "UNION",
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 5,
"filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<intersect2,3,4>",
"access_type": "ALL",
"query_specifications": [
{
"query_block": {
"select_id": 2,
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 6,
"filtered": 100
}
}
},
{
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
"table": {
"message": "No tables used"
}
}
},
{
"query_block": {
"select_id": 4,
"operation": "INTERSECT",
"table": {
"table_name": "<derived5>",
"access_type": "ALL",
"rows": 10,
"filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<union5,6>",
"access_type": "ALL",
"query_specifications": [
{
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 5,
"filtered": 100,
"materialized": {
"query_block": {
"union_result": {
"table_name": "<intersect2,3,4>",
"access_type": "ALL",
"query_specifications": [
{
"query_block": {
"select_id": 2,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 6,
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
"table": {
"message": "No tables used"
}
}
},
{
"query_block": {
"select_id": 4,
"operation": "INTERSECT",
"nested_loop": [
{
"table": {
"table_name": "<derived5>",
"access_type": "ALL",
"rows": 10,
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 5,
"table": {
"table_name": "t1",
"union_result": {
"table_name": "<union5,6>",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
}
},
{
"query_block": {
"select_id": 6,
"operation": "UNION",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100
"query_specifications": [
{
"query_block": {
"select_id": 5,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 6,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
}
]
}
}
]
}
}
}
]
}
}
}
]
}
}
}
]
}
]
}
}
}
}
}
]
}
},
{
"query_block": {
"select_id": 7,
"operation": "EXCEPT",
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 9,
"operation": "UNION",
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 6,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 6,
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 10,
"operation": "UNION",
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 11,
"operation": "EXCEPT",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 6,
"filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
},
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL"
}
{
"block-nl-join": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 6,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL"
}
}
]
}
},
{
"query_block": {
"select_id": 12,
"operation": "UNION",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100,
"attached_condition": "t1.a < 4"
},
"block-nl-join": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 6,
"filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100,
"attached_condition": "t1.a < 4"
}
},
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL"
}
{
"block-nl-join": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 6,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL"
}
}
]
}
},
{
"query_block": {
"select_id": 13,
"operation": "UNION",
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
}
]
}
}
]

View File

@ -48,17 +48,21 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
],
"subqueries": [
{
"expression_cache": {
@ -68,18 +72,22 @@ ANALYZE
"select_id": 2,
"r_loops": 4,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 4,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 18.75,
"attached_condition": "t1.b = t2.c"
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 4,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 18.75,
"attached_condition": "t1.b = t2.c"
}
}
]
}
}
}
@ -94,17 +102,21 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
],
"subqueries": [
{
"expression_cache": {
@ -122,18 +134,22 @@ ANALYZE
"select_id": 3,
"r_loops": 4,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 4,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 18.75,
"attached_condition": "t1.b = t2.c"
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 4,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 18.75,
"attached_condition": "t1.b = t2.c"
}
}
]
}
},
{
@ -158,18 +174,22 @@ ANALYZE
"select_id": 2,
"r_loops": 4,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 4,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 18.75,
"attached_condition": "t1.b = t2.c"
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 4,
"rows": 4,
"r_rows": 4,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 18.75,
"attached_condition": "t1.b = t2.c"
}
}
]
}
}
}
@ -182,25 +202,33 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
},
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
}
],
"subqueries": [
{
"expression_cache": {
"state": "uninitialized",
"query_block": {
"select_id": 2,
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 4,
"filtered": 100,
"attached_condition": "t1.b = t2.c"
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 4,
"filtered": 100,
"attached_condition": "t1.b = t2.c"
}
}
]
}
}
}
@ -213,12 +241,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
},
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
}
],
"subqueries": [
{
"expression_cache": {
@ -231,13 +263,17 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 4,
"filtered": 100,
"attached_condition": "t1.b = t2.c"
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 4,
"filtered": 100,
"attached_condition": "t1.b = t2.c"
}
}
]
}
},
{
@ -259,13 +295,17 @@ EXPLAIN
"state": "uninitialized",
"query_block": {
"select_id": 2,
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 4,
"filtered": 100,
"attached_condition": "t1.b = t2.c"
}
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 4,
"filtered": 100,
"attached_condition": "t1.b = t2.c"
}
}
]
}
}
}

View File

@ -7404,34 +7404,46 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100
},
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
}
],
"subqueries": [
{
"query_block": {
"select_id": 2,
"pseudo_bits_condition": "1 = t1.a or <in_optimizer>(1,<exists>(subquery#3))",
"table": {
"table_name": "t2",
"access_type": "system",
"rows": 1,
"filtered": 100
},
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "system",
"rows": 1,
"filtered": 100
}
}
],
"subqueries": [
{
"query_block": {
"select_id": 3,
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "1 = t3.c"
}
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "1 = t3.c"
}
}
]
}
}
]

View File

@ -1403,18 +1403,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t0.a"
"sorts": [
{
"filesort": {
"sort_key": "t0.a"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t0",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
}
]
}
}
}
@ -1434,18 +1440,24 @@ EXPLAIN
"filesort": {
"sort_key": "t1.a",
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "sum(t1.b)"
"sorts": [
{
"filesort": {
"sort_key": "sum(t1.b)"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
}
]
}
}
}
@ -1463,18 +1475,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "sum(t1.b)"
"sorts": [
{
"filesort": {
"sort_key": "sum(t1.b)"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
}
]
}
}
}
@ -1497,18 +1515,24 @@ EXPLAIN
"filesort": {
"sort_key": "t1.b",
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.b"
"sorts": [
{
"filesort": {
"sort_key": "t1.b"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
}
]
}
}
}
@ -1642,18 +1666,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.c, t1.a"
"sorts": [
{
"filesort": {
"sort_key": "t1.c, t1.a"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
]
}
}
}
@ -1668,18 +1698,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.a"
"sorts": [
{
"filesort": {
"sort_key": "t1.a"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
]
}
}
}
@ -1694,18 +1730,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.c, t1.a"
"sorts": [
{
"filesort": {
"sort_key": "t1.c, t1.a"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
]
}
}
}
@ -1720,18 +1762,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.c, t1.a"
"sorts": [
{
"filesort": {
"sort_key": "t1.c, t1.a"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
]
}
}
}
@ -1776,18 +1824,24 @@ EXPLAIN
"filesort": {
"sort_key": "row_number() over ( order by t1.s1,t1.s2) desc",
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.s1, t1.s2"
"sorts": [
{
"filesort": {
"sort_key": "t1.s1, t1.s2"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 6,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 6,
"filtered": 100
}
}
]
}
}
}
@ -1929,18 +1983,24 @@ EXPLAIN
"select_id": 1,
"duplicate_removal": {
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.part_id, t1.a"
"sorts": [
{
"filesort": {
"sort_key": "t1.part_id, t1.a"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 9,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 9,
"filtered": 100
}
}
]
}
}
}
@ -2102,18 +2162,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.a, t1.pk"
"sorts": [
{
"filesort": {
"sort_key": "t1.a, t1.pk"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100
}
}
]
}
}
}
@ -2163,18 +2229,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.a, t1.b"
"sorts": [
{
"filesort": {
"sort_key": "t1.a, t1.b"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 6,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 6,
"filtered": 100
}
}
]
}
}
}
@ -3755,29 +3827,35 @@ ANALYZE
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "`row_number() OVER()`",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 3,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,rowid"
"sorts": [
{
"filesort": {
"sort_key": "`row_number() OVER()`",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 3,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,rowid"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
}
}

View File

@ -37,22 +37,28 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "pk"
"sorts": [
{
"filesort": {
"sort_key": "pk"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "index",
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["pk"],
"rows": 11,
"filtered": 100,
"using_index": true
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "index",
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["pk"],
"rows": 11,
"filtered": 100,
"using_index": true
}
}
]
}
}
}
@ -63,22 +69,28 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "`row_number() over ()`"
"sorts": [
{
"filesort": {
"sort_key": "`row_number() over ()`"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "index",
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["pk"],
"rows": 11,
"filtered": 100,
"using_index": true
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "index",
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["pk"],
"rows": 11,
"filtered": 100,
"using_index": true
}
}
]
}
}
}

View File

@ -1409,18 +1409,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t0.a"
"sorts": [
{
"filesort": {
"sort_key": "t0.a"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t0",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
}
]
}
}
}
@ -1440,18 +1446,24 @@ EXPLAIN
"filesort": {
"sort_key": "t1.a",
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "sum(t1.b)"
"sorts": [
{
"filesort": {
"sort_key": "sum(t1.b)"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
}
]
}
}
}
@ -1469,18 +1481,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "sum(t1.b)"
"sorts": [
{
"filesort": {
"sort_key": "sum(t1.b)"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
}
]
}
}
}
@ -1503,18 +1521,24 @@ EXPLAIN
"filesort": {
"sort_key": "t1.b",
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.b"
"sorts": [
{
"filesort": {
"sort_key": "t1.b"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
}
}
]
}
}
}
@ -1648,18 +1672,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.c, t1.a"
"sorts": [
{
"filesort": {
"sort_key": "t1.c, t1.a"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
]
}
}
}
@ -1674,18 +1704,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.a"
"sorts": [
{
"filesort": {
"sort_key": "t1.a"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
]
}
}
}
@ -1700,18 +1736,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.c, t1.a"
"sorts": [
{
"filesort": {
"sort_key": "t1.c, t1.a"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
]
}
}
}
@ -1726,18 +1768,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.c, t1.a"
"sorts": [
{
"filesort": {
"sort_key": "t1.c, t1.a"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
]
}
}
}
@ -1782,18 +1830,24 @@ EXPLAIN
"filesort": {
"sort_key": "row_number() over ( order by t1.s1,t1.s2) desc",
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.s1, t1.s2"
"sorts": [
{
"filesort": {
"sort_key": "t1.s1, t1.s2"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 6,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 6,
"filtered": 100
}
}
]
}
}
}
@ -1935,18 +1989,24 @@ EXPLAIN
"select_id": 1,
"duplicate_removal": {
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.part_id, t1.a"
"sorts": [
{
"filesort": {
"sort_key": "t1.part_id, t1.a"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 9,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 9,
"filtered": 100
}
}
]
}
}
}
@ -2108,18 +2168,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.a, t1.pk"
"sorts": [
{
"filesort": {
"sort_key": "t1.a, t1.pk"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 11,
"filtered": 100
}
}
]
}
}
}
@ -2169,18 +2235,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t1.a, t1.b"
"sorts": [
{
"filesort": {
"sort_key": "t1.a, t1.b"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 6,
"filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 6,
"filtered": 100
}
}
]
}
}
}
@ -3761,29 +3833,35 @@ ANALYZE
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "`row_number() OVER()`",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 3,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,rowid"
"sorts": [
{
"filesort": {
"sort_key": "`row_number() OVER()`",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 3,
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,rowid"
}
}
},
],
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 3,
"r_rows": 3,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
}
]
}
}
}

View File

@ -157,31 +157,37 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 7,
"filtered": 100
},
"table": {
"table_name": "<derived2>",
"access_type": "ref",
"possible_keys": ["key0"],
"key": "key0",
"key_length": "18",
"used_key_parts": ["name"],
"ref": ["federated.t3.name"],
"rows": 2,
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
"table": {
"message": "Pushed derived"
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 7,
"filtered": 100
}
},
{
"table": {
"table_name": "<derived2>",
"access_type": "ref",
"possible_keys": ["key0"],
"key": "key0",
"key_length": "18",
"used_key_parts": ["name"],
"ref": ["federated.t3.name"],
"rows": 2,
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
"table": {
"message": "Pushed derived"
}
}
}
}
}
}
]
}
}
ANALYZE
@ -221,41 +227,47 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"table": {
"table_name": "<derived2>",
"access_type": "ref",
"possible_keys": ["key0"],
"key": "key0",
"key_length": "18",
"used_key_parts": ["name"],
"ref": ["federated.t3.name"],
"r_loops": 7,
"rows": 2,
"r_rows": 0,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
"table": {
"message": "Pushed derived"
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"table": {
"table_name": "<derived2>",
"access_type": "ref",
"possible_keys": ["key0"],
"key": "key0",
"key_length": "18",
"used_key_parts": ["name"],
"ref": ["federated.t3.name"],
"r_loops": 7,
"rows": 2,
"r_rows": 0,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
"table": {
"message": "Pushed derived"
}
}
}
}
}
}
]
}
}
SELECT t.id, federated.t3.name
@ -346,31 +358,37 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t5",
"access_type": "ALL",
"rows": 2,
"filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 5,
"filtered": 100
"nested_loop": [
{
"table": {
"table_name": "t5",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
},
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL",
"materialized": {
"query_block": {
"select_id": 2,
{
"block-nl-join": {
"table": {
"message": "Pushed derived"
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 5,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL",
"materialized": {
"query_block": {
"select_id": 2,
"table": {
"message": "Pushed derived"
}
}
}
}
}
}
]
}
}
drop table t5;

View File

@ -211,13 +211,17 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "tt",
"access_type": "ALL",
"rows": 40,
"filtered": 100,
"table_function": "json_table"
}
"nested_loop": [
{
"table": {
"table_name": "tt",
"access_type": "ALL",
"rows": 40,
"filtered": 100,
"table_function": "json_table"
}
}
]
}
}
explain select * from

View File

@ -189,13 +189,17 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "tt",
"access_type": "ALL",
"rows": 40,
"filtered": 100,
"table_function": "json_table"
}
"nested_loop": [
{
"table": {
"table_name": "tt",
"access_type": "ALL",
"rows": 40,
"filtered": 100,
"table_function": "json_table"
}
}
]
}
}
select * from

View File

@ -25,6 +25,8 @@
#include "opt_range.h"
#include "sql_expression_cache.h"
#include <stack>
const char * STR_DELETING_ALL_ROWS= "Deleting all rows";
const char * STR_IMPOSSIBLE_WHERE= "Impossible WHERE";
const char * STR_NO_ROWS_AFTER_PRUNING= "No matching rows after partition pruning";
@ -41,7 +43,7 @@ static void write_item(Json_writer *writer, Item *item);
static void append_item_to_str(String *out, Item *item);
Explain_query::Explain_query(THD *thd_arg, MEM_ROOT *root) :
mem_root(root), upd_del_plan(NULL), insert_plan(NULL),
mem_root(root), upd_del_plan(nullptr), insert_plan(nullptr),
unions(root), selects(root), thd(thd_arg), apc_enabled(false),
operations(0)
{
@ -1062,14 +1064,13 @@ void Explain_aggr_window_funcs::print_json_members(Json_writer *writer,
{
Explain_aggr_filesort *srt;
List_iterator<Explain_aggr_filesort> it(sorts);
writer->add_member("sorts").start_object();
Json_writer_array sorts(writer, "sorts");
while ((srt= it++))
{
writer->add_member("filesort").start_object();
Json_writer_object sort(writer);
Json_writer_object filesort(writer, "filesort");
srt->print_json_members(writer, is_analyze);
writer->end_object(); // filesort
}
writer->end_object(); // sorts
}
@ -1091,17 +1092,22 @@ print_explain_json_interns(Explain_query *query,
Json_writer *writer,
bool is_analyze)
{
Json_writer_nesting_guard guard(writer);
for (uint i=0; i< n_join_tabs; i++)
{
if (join_tabs[i]->start_dups_weedout)
writer->add_member("duplicates_removal").start_object();
Json_writer_array loop(writer, "nested_loop");
for (uint i=0; i< n_join_tabs; i++)
{
if (join_tabs[i]->start_dups_weedout)
{
writer->start_object();
writer->add_member("duplicates_removal");
}
join_tabs[i]->print_explain_json(query, writer, is_analyze);
join_tabs[i]->print_explain_json(query, writer, is_analyze);
if (join_tabs[i]->end_dups_weedout)
writer->end_object();
}
if (join_tabs[i]->end_dups_weedout)
writer->end_object();
}
} // "nested_loop"
print_explain_json_for_children(query, writer, is_analyze);
}
@ -1685,7 +1691,7 @@ void Explain_table_access::print_explain_json(Explain_query *query,
Json_writer *writer,
bool is_analyze)
{
Json_writer_nesting_guard guard(writer);
Json_writer_object jsobj(writer);
if (pre_join_sort)
{
@ -2081,14 +2087,15 @@ void Explain_quick_select::print_json(Json_writer *writer)
}
else
{
writer->add_member(get_name_by_type()).start_object();
Json_writer_array ranges(writer, get_name_by_type());
List_iterator_fast<Explain_quick_select> it (children);
Explain_quick_select* child;
while ((child = it++))
{
Json_writer_object obj(writer);
child->print_json(writer);
writer->end_object();
}
}
}

View File

@ -7922,16 +7922,14 @@ best_access_path(JOIN *join,
}
else
{
trace_access_idx.add("used_range_estimates", false);
if (table->opt_range_keys.is_set(key))
{
trace_access_idx.add("used_range_estimates",false)
.add("cause",
"not better than ref estimates");
trace_access_idx.add("reason", "not better than ref estimates");
}
else
{
trace_access_idx.add("used_range_estimates", false)
.add("cause", "not available");
trace_access_idx.add("reason", "not available");
}
}
}
@ -8169,7 +8167,7 @@ best_access_path(JOIN *join,
trace_access_idx.add("chosen", false)
.add("cause", cause ? cause : "cost");
}
cause= NULL;
cause= nullptr;
} /* for each key */
records= best_records;
}
@ -8191,7 +8189,6 @@ best_access_path(JOIN *join,
(!(s->table->map & join->outer_join) ||
join->allowed_outer_join_with_cache)) // (2)
{
Json_writer_object trace_access_hash(thd);
double join_sel= 0.1;
/* Estimate the cost of the hash join access to the table */
double rnd_records= matching_candidates_in_table(s, found_constraint,
@ -8217,9 +8214,10 @@ best_access_path(JOIN *join,
best_uses_jbuf= TRUE;
best_filter= 0;
best_type= JT_HASH;
Json_writer_object trace_access_hash(thd);
trace_access_hash.add("type", "hash");
trace_access_hash.add("index", "hj-key");
trace_access_hash.add("cost", rnd_records);
trace_access_hash.add("rnd_records", rnd_records);
trace_access_hash.add("cost", best);
trace_access_hash.add("chosen", true);
}

View File

@ -47,18 +47,22 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t3",
"access_type": "range",
"possible_keys": ["kp1"],
"key": "kp1",
"key_length": "5",
"used_key_parts": ["kp1"],
"rows": 1000,
"filtered": 100,
"index_condition": "t3.kp1 between 2 and 4 and t3.kp1 MOD 3 = 0",
"attached_condition": "t3.kp2 like '%foo%'"
}
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "range",
"possible_keys": ["kp1"],
"key": "kp1",
"key_length": "5",
"used_key_parts": ["kp1"],
"rows": 1000,
"filtered": 100,
"index_condition": "t3.kp1 between 2 and 4 and t3.kp1 MOD 3 = 0",
"attached_condition": "t3.kp2 like '%foo%'"
}
}
]
}
}
# Check that we handle the case where out-of-range is encountered sooner

View File

@ -47,18 +47,22 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t3",
"access_type": "range",
"possible_keys": ["kp1"],
"key": "kp1",
"key_length": "5",
"used_key_parts": ["kp1"],
"rows": 1000,
"filtered": 100,
"index_condition": "t3.kp1 between 2 and 4 and t3.kp1 MOD 3 = 0",
"attached_condition": "t3.kp2 like '%foo%'"
}
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "range",
"possible_keys": ["kp1"],
"key": "kp1",
"key_length": "5",
"used_key_parts": ["kp1"],
"rows": 1000,
"filtered": 100,
"index_condition": "t3.kp1 between 2 and 4 and t3.kp1 MOD 3 = 0",
"attached_condition": "t3.kp2 like '%foo%'"
}
}
]
}
}
# Check that we handle the case where out-of-range is encountered sooner