1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +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

View File

@@ -9,6 +9,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
@@ -22,6 +24,8 @@ ANALYZE
"attached_condition": "t0.a < 3"
}
}
]
}
}
create table t1 (a int, b int, c int, key(a));
insert into t1 select A.a*10 + B.a, A.a*10 + B.a, A.a*10 + B.a from t0 A, t0 B;
@@ -38,6 +42,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
@@ -49,7 +55,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 0,
"attached_condition": "t0.a > 9 and t0.a is not null"
}
},
{
"table": {
"table_name": "t1",
"access_type": "ref",
@@ -65,6 +73,8 @@ ANALYZE
"r_filtered": null
}
}
]
}
}
analyze
select * from t0, t1 where t1.a=t0.a and t1.b<4;
@@ -79,6 +89,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
@@ -90,7 +102,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 100,
"attached_condition": "t0.a is not null"
}
},
{
"table": {
"table_name": "t1",
"access_type": "ref",
@@ -109,6 +123,8 @@ ANALYZE
"attached_condition": "t1.b < 4"
}
}
]
}
}
analyze
select * from t1 tbl1, t1 tbl2 where tbl1.b<2 and tbl2.b>5;
@@ -123,6 +139,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "tbl1",
"access_type": "ALL",
@@ -134,7 +152,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 20,
"attached_condition": "tbl1.b < 20"
}
},
{
"block-nl-join": {
"table": {
"table_name": "tbl2",
@@ -154,6 +174,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
analyze format=json
select * from t1 tbl1, t1 tbl2 where tbl1.b<20 and tbl2.b<60 and tbl1.c > tbl2.c;
@@ -163,6 +185,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "tbl1",
"access_type": "ALL",
@@ -174,7 +198,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 20,
"attached_condition": "tbl1.b < 20"
}
},
{
"block-nl-join": {
"table": {
"table_name": "tbl2",
@@ -195,6 +221,8 @@ ANALYZE
"r_filtered": 15.83333333
}
}
]
}
}
drop table t1;
drop table t0;
@@ -212,6 +240,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -223,7 +253,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 100,
"attached_condition": "t1.a is not null"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
@@ -242,6 +274,8 @@ ANALYZE
"using_index": true
}
}
]
}
}
drop table t1,t2;
create table t1(a int);
@@ -264,6 +298,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -277,6 +313,8 @@ ANALYZE
"attached_condition": "test.t1.a < 5"
}
}
]
}
}
disconnect con1;
connection default;
@@ -318,6 +356,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -336,6 +376,8 @@ ANALYZE
"attached_condition": "t1.b > 4"
}
}
]
}
}
analyze format=json
delete from t1 where pk < 10 and b > 4;
@@ -388,6 +430,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -398,7 +442,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"range-checked-for-each-record": {
"keys": ["key1", "key2", "key3", "key4"],
"r_keys": {
@@ -425,6 +471,8 @@ ANALYZE
}
}
}
]
}
}
drop table t1,t2,t3,t4;
#
@@ -449,6 +497,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "tbl1",
"access_type": "ALL",
@@ -462,6 +512,8 @@ ANALYZE
"attached_condition": "tbl1.a < 5"
}
}
]
}
},
{
"query_block": {
@@ -469,6 +521,8 @@ ANALYZE
"operation": "UNION",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "tbl2",
"access_type": "ALL",
@@ -482,6 +536,8 @@ ANALYZE
"attached_condition": "tbl2.a in (2,3)"
}
}
]
}
}
]
}
@@ -519,6 +575,8 @@ ANALYZE
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,rowid",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -531,6 +589,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
}
}
@@ -551,6 +611,8 @@ ANALYZE
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,rowid",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -563,6 +625,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
}
}
@@ -594,6 +658,8 @@ ANALYZE
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,rowid",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -606,6 +672,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
}
}
@@ -624,6 +692,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -634,7 +704,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t2",
@@ -653,13 +725,17 @@ ANALYZE
"join_type": "BNL",
"attached_condition": "<in_optimizer>(t2.b,t2.b in (subquery#2))",
"r_filtered": null
},
}
}
],
"subqueries": [
{
"query_block": {
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -672,6 +748,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -715,6 +793,8 @@ ANALYZE
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,rowid",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -725,7 +805,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t3",
@@ -743,7 +825,9 @@ ANALYZE
"buffer_size": "1",
"join_type": "BNL",
"r_filtered": null
},
}
}
],
"subqueries": [
{
"expression_cache": {
@@ -751,6 +835,8 @@ ANALYZE
"r_loops": 0,
"query_block": {
"select_id": 2,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -759,7 +845,9 @@ ANALYZE
"r_rows": null,
"filtered": 100,
"r_filtered": null
}
},
{
"block-nl-join": {
"table": {
"table_name": "t2",
@@ -777,6 +865,8 @@ ANALYZE
"r_filtered": null
}
}
]
}
}
}
]
@@ -802,6 +892,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -813,7 +905,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 0,
"attached_condition": "t1.a < 0"
},
}
}
],
"subqueries": [
{
"expression_cache": {
@@ -821,6 +915,8 @@ ANALYZE
"r_loops": 0,
"query_block": {
"select_id": 2,
"nested_loop": [
{
"read_sorted_file": {
"r_rows": null,
"filesort": {
@@ -843,6 +939,8 @@ ANALYZE
}
}
}
]
}
}
}
]

View File

@@ -176,13 +176,17 @@ EXPLAIN
"filesort": {
"sort_key": "t2.b",
"temporary_table": {
"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",
@@ -195,6 +199,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -215,6 +221,8 @@ ANALYZE
"r_output_rows": 4,
"r_sort_mode": "sort_key,rowid",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
@@ -226,7 +234,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 100,
"attached_condition": "t0.a is not null"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
@@ -244,6 +254,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
}
}
@@ -261,6 +273,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "t0.a",
@@ -272,7 +286,9 @@ EXPLAIN
"attached_condition": "t0.a is not null"
}
}
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
@@ -285,6 +301,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
analyze format=json
select * from t0,t2 where t2.a=t0.a order by t0.a limit 4;
@@ -294,6 +312,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 10,
"filesort": {
@@ -317,7 +337,9 @@ ANALYZE
"attached_condition": "t0.a is not null"
}
}
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
@@ -335,6 +357,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
drop table t2;
create table t2 (
@@ -365,6 +389,8 @@ ANALYZE
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,rowid",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -378,6 +404,8 @@ ANALYZE
"attached_condition": "t2.a MOD 2 = 0"
}
}
]
}
}
}
}
@@ -414,6 +442,8 @@ ANALYZE
"r_total_time_ms": "REPLACED",
"duplicate_removal": {
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
@@ -424,7 +454,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t3",
@@ -444,6 +476,8 @@ ANALYZE
"r_filtered": 10
}
}
]
}
}
}
}
@@ -488,6 +522,8 @@ ANALYZE
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,rowid",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t6",
"access_type": "ALL",
@@ -499,7 +535,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 80,
"attached_condition": "t6.b > 0 and t6.a <= 5"
}
},
{
"block-nl-join": {
"table": {
"table_name": "t5",
@@ -519,6 +557,8 @@ ANALYZE
"r_filtered": 21.42857143
}
}
]
}
}
}
}
@@ -538,13 +578,17 @@ EXPLAIN
"filesort": {
"sort_key": "t5.a",
"temporary_table": {
"nested_loop": [
{
"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",
@@ -558,6 +602,8 @@ EXPLAIN
"attached_condition": "t5.a = t6.a"
}
}
]
}
}
}
}
@@ -593,6 +639,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
@@ -609,6 +657,8 @@ ANALYZE
"using_index_for_group_by": true
}
}
]
}
}
drop table t2;
drop table t0,t1;

View File

@@ -261,6 +261,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc",
@@ -273,6 +275,8 @@ EXPLAIN
}
}
}
]
}
}
(select a from t1 order by a desc) limit 1;
a
@@ -287,6 +291,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc",
@@ -299,6 +305,8 @@ EXPLAIN
}
}
}
]
}
}
(select a from t1 where a=20 union select a from t1) order by a desc limit 1;
a
@@ -321,6 +329,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -329,11 +339,15 @@ EXPLAIN
"attached_condition": "t1.a = 20"
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -341,6 +355,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
]
}
@@ -367,6 +383,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -375,11 +393,15 @@ EXPLAIN
"attached_condition": "t1.a = 20"
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -387,6 +409,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
]
}
@@ -421,6 +445,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "t1.pk",
@@ -433,11 +459,15 @@ EXPLAIN
}
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -446,6 +476,8 @@ EXPLAIN
"attached_condition": "t1.pk > 4"
}
}
]
}
}
]
}

View File

@@ -1339,6 +1339,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
@@ -1353,6 +1355,8 @@ EXPLAIN
{
"query_block": {
"select_id": 4,
"nested_loop": [
{
"table": {
"table_name": "folks",
"access_type": "ALL",
@@ -1361,11 +1365,15 @@ EXPLAIN
"attached_condition": "folks.`name` = 'Me2'"
}
}
]
}
},
{
"query_block": {
"select_id": 6,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
@@ -1381,6 +1389,8 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
"nested_loop": [
{
"table": {
"table_name": "folks",
"access_type": "ALL",
@@ -1389,18 +1399,24 @@ EXPLAIN
"attached_condition": "folks.`name` = 'Me'"
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "folks",
"access_type": "ALL",
"possible_keys": ["PRIMARY"],
"rows": 12,
"filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "<derived3>",
@@ -1414,6 +1430,8 @@ EXPLAIN
"attached_condition": "prev_gen.father = folks.`id` or prev_gen.mother = folks.`id`"
}
}
]
}
}
]
}
@@ -1421,11 +1439,15 @@ EXPLAIN
}
}
}
]
}
},
{
"query_block": {
"select_id": 5,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
@@ -1434,6 +1456,8 @@ EXPLAIN
"attached_condition": "ancestors.`id` < 234"
}
}
]
}
}
]
}
@@ -1441,6 +1465,8 @@ EXPLAIN
}
}
}
]
}
}
#
explain format=json
@@ -1473,6 +1499,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
@@ -1487,13 +1515,17 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
"nested_loop": [
{
"table": {
"table_name": "v",
"access_type": "ALL",
"rows": 12,
"filtered": 100,
"attached_condition": "v.`name` = 'Me' and v.father is not null and v.mother is not null"
}
},
{
"table": {
"table_name": "h",
"access_type": "eq_ref",
@@ -1504,7 +1536,9 @@ EXPLAIN
"ref": ["test.v.father"],
"rows": 1,
"filtered": 100
}
},
{
"table": {
"table_name": "w",
"access_type": "eq_ref",
@@ -1517,18 +1551,24 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "a.father is not null and a.mother is not null"
}
},
{
"table": {
"table_name": "h",
"access_type": "eq_ref",
@@ -1539,7 +1579,9 @@ EXPLAIN
"ref": ["a.father"],
"rows": 1,
"filtered": 100
}
},
{
"table": {
"table_name": "w",
"access_type": "eq_ref",
@@ -1552,6 +1594,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
]
}
@@ -1559,6 +1603,8 @@ EXPLAIN
}
}
}
]
}
}
create table my_ancestors
with recursive
@@ -1778,6 +1824,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -1792,6 +1840,8 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1799,11 +1849,15 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 3,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -1812,6 +1866,8 @@ EXPLAIN
"attached_condition": "t.a < 1000"
}
}
]
}
}
]
}
@@ -1819,6 +1875,8 @@ EXPLAIN
}
}
}
]
}
}
drop table t1;
#
@@ -2401,6 +2459,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -2433,6 +2493,8 @@ ANALYZE
"operation": "UNION",
"r_loops": 10,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -2446,6 +2508,8 @@ ANALYZE
"attached_condition": "src.counter < 10"
}
}
]
}
}
]
}
@@ -2453,6 +2517,8 @@ ANALYZE
}
}
}
]
}
}
#
# mdev-12360: recursive reference in left operand of LEFT JOIN
@@ -3799,6 +3865,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -3810,7 +3878,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 100,
"attached_condition": "t1.a1 is not null"
}
},
{
"table": {
"table_name": "<derived3>",
"access_type": "ref",
@@ -3840,6 +3910,8 @@ ANALYZE
"select_id": 3,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "const",
@@ -3856,6 +3928,8 @@ ANALYZE
"using_index": true
}
}
]
}
},
{
"query_block": {
@@ -3863,6 +3937,8 @@ ANALYZE
"operation": "UNION",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
@@ -3874,7 +3950,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 100,
"attached_condition": "cte.a2 is not null"
}
},
{
"table": {
"table_name": "tt2",
"access_type": "ref",
@@ -3892,6 +3970,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -3899,6 +3979,8 @@ ANALYZE
}
}
}
]
}
}
drop function f1;
drop table t1,t2;
@@ -4059,6 +4141,8 @@ ANALYZE
"operation": "UNION",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -4082,6 +4166,8 @@ ANALYZE
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "s",
"access_type": "ALL",
@@ -4094,6 +4180,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -4101,6 +4189,8 @@ ANALYZE
"operation": "UNION",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -4112,7 +4202,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 100,
"attached_condition": "t1.c is not null"
}
},
{
"table": {
"table_name": "<derived2>",
"access_type": "ref",
@@ -4130,6 +4222,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -4137,6 +4231,8 @@ ANALYZE
}
}
}
]
}
}
]
}
@@ -4197,6 +4293,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "tt",
"access_type": "ALL",
@@ -4209,6 +4307,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
prepare stmt from "with h_cte as
( with recursive r_cte as

File diff suppressed because it is too large Load Diff

View File

@@ -381,13 +381,17 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"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",
@@ -404,6 +408,8 @@ EXPLAIN
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -412,11 +418,15 @@ EXPLAIN
"attached_condition": "t1.f1 in (2,3)"
}
}
]
}
}
}
}
}
}
]
}
}
select * from v1 join v4 on f1=f2;
f1 f11 f2 f22
@@ -475,6 +485,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -486,6 +498,8 @@ EXPLAIN
"filesort": {
"sort_key": "tt.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
@@ -498,6 +512,8 @@ EXPLAIN
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -506,16 +522,22 @@ EXPLAIN
"attached_condition": "t1.f1 < 7 and t1.f1 > 2"
}
}
]
}
}
}
}
}
}
]
}
}
}
}
}
}
]
}
}
select * from (select * from
(select * from t1 where f1 < 7 group by f1) tt where f1 > 2 group by f1) zz;
@@ -544,6 +566,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
@@ -556,6 +580,8 @@ EXPLAIN
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -564,10 +590,14 @@ EXPLAIN
"attached_condition": "t1.f1 < 7 and t1.f1 > 2 and t1.f1 > 2"
}
}
]
}
}
}
}
}
},
{
"table": {
"table_name": "<derived5>",
"access_type": "ref",
@@ -584,6 +614,8 @@ EXPLAIN
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -592,11 +624,15 @@ EXPLAIN
"attached_condition": "t1.f1 < 7 and t1.f1 > 2 and t1.f1 > 2"
}
}
]
}
}
}
}
}
}
]
}
}
flush status;
select * from
@@ -671,6 +707,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -683,6 +721,8 @@ EXPLAIN
"filesort": {
"sort_key": "tt.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
@@ -695,6 +735,8 @@ EXPLAIN
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -703,15 +745,21 @@ EXPLAIN
"attached_condition": "t1.f1 < 7 and t1.f1 > 2"
}
}
]
}
}
}
}
}
}
]
}
}
}
}
}
},
{
"table": {
"table_name": "<derived4>",
"access_type": "ref",
@@ -728,6 +776,8 @@ EXPLAIN
"filesort": {
"sort_key": "tt.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "<derived5>",
"access_type": "ALL",
@@ -740,6 +790,8 @@ EXPLAIN
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -748,16 +800,22 @@ EXPLAIN
"attached_condition": "t1.f1 < 7 and t1.f1 > 2"
}
}
]
}
}
}
}
}
}
]
}
}
}
}
}
}
]
}
}
select * from
(select * from
@@ -795,6 +853,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
@@ -807,6 +867,8 @@ EXPLAIN
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -815,11 +877,15 @@ EXPLAIN
"attached_condition": "t1.f1 < 7"
}
}
]
}
}
}
}
}
}
]
}
}
select * from ( select * from v1 where f1 < 7) tt;
f1 f11
@@ -873,13 +939,17 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"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",
@@ -896,6 +966,8 @@ EXPLAIN
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -904,11 +976,15 @@ EXPLAIN
"attached_condition": "t1.f1 < 7 and t1.f1 in (2,3)"
}
}
]
}
}
}
}
}
}
]
}
}
select * from v6 join v7 on f2=f1;
f2 f22 f1 f11

View File

@@ -37,6 +37,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -44,11 +46,15 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "EXCEPT",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -56,6 +62,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
]
}
@@ -76,6 +84,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -88,6 +98,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -95,6 +107,8 @@ ANALYZE
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -107,6 +121,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -119,6 +135,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -142,6 +160,8 @@ ANALYZE
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -154,6 +174,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -161,6 +183,8 @@ ANALYZE
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -173,6 +197,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -180,6 +206,8 @@ ANALYZE
}
}
}
]
}
}
select * from ((select a,b from t1) except (select c,d from t2)) a;
a b
@@ -247,12 +275,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t3",
@@ -265,17 +297,23 @@ EXPLAIN
"join_type": "BNL"
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "EXCEPT",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t4",
@@ -288,6 +326,8 @@ EXPLAIN
"join_type": "BNL"
}
}
]
}
}
]
}
@@ -308,6 +348,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -318,7 +360,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t3",
@@ -337,6 +381,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -344,6 +390,8 @@ ANALYZE
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -354,7 +402,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t4",
@@ -373,6 +423,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -386,6 +438,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -409,6 +463,8 @@ ANALYZE
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -419,7 +475,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t3",
@@ -438,6 +496,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -445,6 +505,8 @@ ANALYZE
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -455,7 +517,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t4",
@@ -474,6 +538,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -481,6 +547,8 @@ ANALYZE
}
}
}
]
}
}
select * from ((select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4)) a;
a b e f

View File

@@ -65,6 +65,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -72,11 +74,15 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "EXCEPT",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -84,6 +90,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
]
}
@@ -111,6 +119,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -134,6 +144,8 @@ ANALYZE
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -146,6 +158,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -153,6 +167,8 @@ ANALYZE
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -165,6 +181,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -172,6 +190,8 @@ ANALYZE
}
}
}
]
}
}
ANALYZE format=json select * from ((select a from t1) except all (select c from t2)) a;
ANALYZE
@@ -180,6 +200,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -203,6 +225,8 @@ ANALYZE
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -215,6 +239,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -222,6 +248,8 @@ ANALYZE
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -234,6 +262,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -241,6 +271,8 @@ ANALYZE
}
}
}
]
}
}
select * from ((select a from t1) except all (select c from t2)) a;
a
@@ -349,6 +381,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -363,12 +397,16 @@ EXPLAIN
{
"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",
@@ -381,17 +419,23 @@ EXPLAIN
"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",
@@ -404,6 +448,8 @@ EXPLAIN
"join_type": "BNL"
}
}
]
}
}
]
}
@@ -411,6 +457,8 @@ EXPLAIN
}
}
}
]
}
}
ANALYZE format=json (select a,b,e,f from t1,t3) except all (select c,d,g,h from t2,t4);
ANALYZE
@@ -427,6 +475,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -437,7 +487,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t3",
@@ -456,6 +508,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -463,6 +517,8 @@ ANALYZE
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -473,7 +529,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t4",
@@ -492,6 +550,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -504,6 +564,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -527,6 +589,8 @@ ANALYZE
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -537,7 +601,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t3",
@@ -556,6 +622,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -563,6 +631,8 @@ ANALYZE
"operation": "EXCEPT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -573,7 +643,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t4",
@@ -592,6 +664,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -599,6 +673,8 @@ ANALYZE
}
}
}
]
}
}
prepare stmt from "(select a,b,e,f from t1,t3) except all (select c,d,g,h from t2,t4)";
execute stmt;

File diff suppressed because it is too large Load Diff

View File

@@ -12,6 +12,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"partitions": ["p0"],
@@ -21,6 +23,8 @@ EXPLAIN
"attached_condition": "t1.a in (2,3,4)"
}
}
]
}
}
analyze format=json select * from t1 where a in (2,3,4);
ANALYZE
@@ -29,6 +33,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"partitions": ["p0"],
@@ -43,6 +49,8 @@ ANALYZE
"attached_condition": "t1.a in (2,3,4)"
}
}
]
}
}
analyze format=json update t1 set a=a+10 where a in (2,3,4);
ANALYZE

View File

@@ -16,23 +16,31 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100
},
}
}
],
"subqueries": [
{
"query_block": {
"select_id": 2,
"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",
@@ -50,6 +58,8 @@ EXPLAIN
"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,8 +265,8 @@
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,
@@ -768,11 +768,12 @@
{
"table": {
"table_name": "t1",
- "access_type": "range",
@@ -281,7 +281,7 @@
"rows": 1,
"filtered": 100,
"index_condition": "t1.pk1 <= 5 and t1.pk2 <= 5 and t1.f2 = 'abc'",
@@ -788,8 +789,8 @@
@@ -805,8 +806,8 @@
"access_type": "range",
"possible_keys": ["k1"],
"key": "k1",

View File

@@ -764,6 +764,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -777,6 +779,8 @@ EXPLAIN
"attached_condition": "t1.f1 <= '3'"
}
}
]
}
}
drop table t1;
CREATE TABLE t1 (
@@ -794,6 +798,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -807,6 +813,8 @@ EXPLAIN
"attached_condition": "t1.f1 <= '3'"
}
}
]
}
}
drop table t1;
SET optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;

View File

@@ -51,6 +51,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -58,11 +60,15 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -70,11 +76,15 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
@@ -82,6 +92,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
]
}
@@ -102,6 +114,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -114,6 +128,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -121,6 +137,8 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -133,6 +151,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -140,6 +160,8 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
@@ -152,6 +174,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -164,6 +188,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -187,6 +213,8 @@ ANALYZE
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -199,6 +227,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -206,6 +236,8 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -218,6 +250,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -225,6 +259,8 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
@@ -237,6 +273,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -244,6 +282,8 @@ ANALYZE
}
}
}
]
}
}
select * from ((select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3)) a;
a b
@@ -300,6 +340,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -307,17 +349,23 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t3",
@@ -330,6 +378,8 @@ EXPLAIN
"join_type": "BNL"
}
}
]
}
}
]
}
@@ -350,6 +400,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -362,6 +414,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -369,6 +423,8 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -379,7 +435,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t3",
@@ -398,6 +456,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -410,6 +470,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -433,6 +495,8 @@ ANALYZE
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -445,6 +509,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -452,6 +518,8 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -462,7 +530,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t3",
@@ -481,6 +551,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -488,6 +560,8 @@ ANALYZE
}
}
}
]
}
}
set @@optimizer_switch=@save_optimizer_switch;
select * from ((select a,b from t1) intersect (select c,e from t2,t3)) a;

View File

@@ -63,6 +63,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -70,11 +72,15 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -82,11 +88,15 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
@@ -94,6 +104,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
]
}
@@ -114,6 +126,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -126,6 +140,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -133,6 +149,8 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -145,6 +163,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -152,6 +172,8 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
@@ -164,6 +186,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -176,6 +200,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -199,6 +225,8 @@ ANALYZE
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -211,6 +239,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -218,6 +248,8 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -230,6 +262,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -237,6 +271,8 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
@@ -249,6 +285,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -256,6 +294,8 @@ ANALYZE
}
}
}
]
}
}
select * from ((select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3)) a;
a b
@@ -331,6 +371,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -338,17 +380,23 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t2",
@@ -361,6 +409,8 @@ EXPLAIN
"join_type": "BNL"
}
}
]
}
}
]
}
@@ -381,6 +431,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -393,6 +445,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -400,6 +454,8 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
@@ -410,7 +466,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t2",
@@ -429,6 +487,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -441,6 +501,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -464,6 +526,8 @@ ANALYZE
"select_id": 2,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -476,6 +540,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -483,6 +549,8 @@ ANALYZE
"operation": "INTERSECT",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
@@ -493,7 +561,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t2",
@@ -512,6 +582,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
]
}
@@ -519,6 +591,8 @@ ANALYZE
}
}
}
]
}
}
select * from ((select a,b from t1) intersect all (select c,e from t2,t3)) a;
a b

View File

@@ -6195,6 +6195,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "a",
"access_type": "range",
@@ -6206,7 +6208,9 @@ EXPLAIN
"filtered": 100,
"attached_condition": "a.a <= 10",
"using_index": true
}
},
{
"block-nl-join": {
"table": {
"table_name": "b",
@@ -6226,6 +6230,8 @@ EXPLAIN
"attached_condition": "b.kp1 = a.a"
}
}
]
}
}
drop table t1,t2,t3;
# End of 10.3 tests

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,6 +7980,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -7992,6 +7994,8 @@ EXPLAIN
"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;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
@@ -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,6 +7,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -19,6 +21,8 @@ EXPLAIN
"index_condition": "t1.col1 >= 'a'"
}
}
]
}
}
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))

View File

@@ -3401,6 +3401,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 5,
"filesort": {
@@ -3426,6 +3428,8 @@ ANALYZE
}
}
}
]
}
}
SELECT * FROM t1 ORDER BY a LIMIT 5;
a b
@@ -3708,6 +3712,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 100,
"filesort": {
@@ -3732,6 +3738,8 @@ ANALYZE
}
}
}
]
}
}
select * from t1 order by a,b,c;
a b c
@@ -3867,6 +3875,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 5,
"filesort": {
@@ -3891,6 +3901,8 @@ ANALYZE
}
}
}
]
}
}
drop table t1;
#
@@ -3909,6 +3921,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 6,
"filesort": {
@@ -3933,6 +3947,8 @@ ANALYZE
}
}
}
]
}
}
select a, b, c from t1 order by a, b;
a b c
@@ -3957,6 +3973,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 6,
"filesort": {
@@ -3981,6 +3999,8 @@ ANALYZE
}
}
}
]
}
}
select a, b, c from t1 order by a, b;
a b c
@@ -4019,6 +4039,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 10,
"filesort": {
@@ -4043,6 +4065,8 @@ ANALYZE
}
}
}
]
}
}
drop table t1;
#
@@ -4194,6 +4218,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -4204,7 +4230,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
}
}
],
"subqueries": [
{
"expression_cache": {
@@ -4223,6 +4251,8 @@ ANALYZE
"r_buffer_size": "REPLACED" across executions)",
"r_sort_mode": "sort_key,rowid",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -4236,6 +4266,8 @@ ANALYZE
"attached_condition": "t1.b = t2.b"
}
}
]
}
}
}
}
@@ -4324,6 +4356,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc",
@@ -4337,6 +4371,8 @@ EXPLAIN
"unique": 1,
"query_block": {
"select_id": 2,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -4345,10 +4381,14 @@ EXPLAIN
"attached_condition": "t2.b = 3 and t2.a is not null"
}
}
]
}
}
}
}
}
},
{
"table": {
"table_name": "t1",
"access_type": "eq_ref",
@@ -4362,6 +4402,8 @@ EXPLAIN
"using_index": true
}
}
]
}
}
SELECT t1.a
FROM t1
@@ -4387,6 +4429,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc",
@@ -4400,6 +4444,8 @@ EXPLAIN
"unique": 1,
"query_block": {
"select_id": 2,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -4408,10 +4454,14 @@ EXPLAIN
"attached_condition": "t2.b = 3 and t2.a is not null"
}
}
]
}
}
}
}
}
},
{
"table": {
"table_name": "t1",
"access_type": "eq_ref",
@@ -4424,6 +4474,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
SELECT t1.a, group_concat(t1.b)
FROM t1

View File

@@ -93,6 +93,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 10000,
"filesort": {
@@ -117,6 +119,8 @@ ANALYZE
}
}
}
]
}
}
flush status;
select id DIV 100 as x,
@@ -250,6 +254,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 10000,
"filesort": {
@@ -275,6 +281,8 @@ ANALYZE
}
}
}
]
}
}
flush status;
select id DIV 100 as x,
@@ -405,6 +413,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 10000,
"filesort": {
@@ -429,6 +439,8 @@ ANALYZE
}
}
}
]
}
}
flush status;
SELECT id, names, address INTO OUTFILE '$file1' FROM t3 ORDER BY names, address;
@@ -454,6 +466,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"read_sorted_file": {
"r_rows": 10000,
"filesort": {
@@ -478,6 +492,8 @@ ANALYZE
}
}
}
]
}
}
flush status;
SELECT id, names, address INTO OUTFILE '$file1' FROM t3 ORDER BY names, address;

View File

@@ -2412,6 +2412,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -2424,6 +2426,8 @@ EXPLAIN
"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));
a b c
@@ -2472,6 +2476,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -2484,6 +2490,8 @@ EXPLAIN
"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));
a b c
@@ -2498,6 +2506,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -2510,6 +2520,8 @@ EXPLAIN
"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));
a b c
@@ -2538,6 +2550,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
@@ -2557,7 +2571,9 @@ EXPLAIN
"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",
@@ -2570,6 +2586,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(2,2));
@@ -2618,6 +2636,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
@@ -2637,7 +2657,9 @@ EXPLAIN
"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",
@@ -2650,6 +2672,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1;
@@ -2723,6 +2747,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
@@ -2742,7 +2768,9 @@ EXPLAIN
"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",
@@ -2755,6 +2783,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
@@ -2781,6 +2811,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
@@ -2792,7 +2824,9 @@ EXPLAIN
"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",
@@ -2805,6 +2839,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
@@ -2830,6 +2866,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -2840,7 +2878,9 @@ EXPLAIN
"rows": 15,
"filtered": 100,
"index_condition": "t1.a is not null"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
@@ -2854,6 +2894,8 @@ EXPLAIN
"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
where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1;
@@ -2887,6 +2929,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -2894,7 +2938,9 @@ EXPLAIN
"rows": 144,
"filtered": 100,
"attached_condition": "t1.a is not null"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
@@ -2908,6 +2954,8 @@ EXPLAIN
"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
where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1;
@@ -2935,6 +2983,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -2946,7 +2996,9 @@ EXPLAIN
"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",
@@ -2960,6 +3012,8 @@ EXPLAIN
"attached_condition": "octet_length(t2.f) = 1"
}
}
]
}
}
select * from t1,t2
where a = d and (a,2) in ((2,2),(7,7),(8,8)) and
@@ -3012,6 +3066,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "const",
@@ -3022,7 +3078,9 @@ EXPLAIN
"ref": ["const"],
"rows": 1,
"filtered": 100
}
},
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -3034,7 +3092,9 @@ EXPLAIN
"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",
@@ -3048,6 +3108,8 @@ EXPLAIN
"attached_condition": "octet_length(t2.f) = 1"
}
}
]
}
}
select * from t1,t2,t3
where id = 1 and a = d and

View File

@@ -2415,6 +2415,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -2428,6 +2430,8 @@ EXPLAIN
"mrr_type": "Rowid-ordered scan"
}
}
]
}
}
select * from t1 where (a,b) IN ((2, 3),(3,3),(8,8),(7,7));
a b c
@@ -2476,6 +2480,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -2489,6 +2495,8 @@ EXPLAIN
"mrr_type": "Rowid-ordered scan"
}
}
]
}
}
select * from t1 where (a,b+a) IN ((4,9),(8,8),(7,7));
a b c
@@ -2503,6 +2511,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -2516,6 +2526,8 @@ EXPLAIN
"mrr_type": "Rowid-ordered scan"
}
}
]
}
}
select * from t1 where (a,b) IN ((4,a-1),(8,a+8),(7,a+7));
a b c
@@ -2544,6 +2556,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
@@ -2556,7 +2570,9 @@ EXPLAIN
"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",
@@ -2569,6 +2585,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(2,2));
@@ -2617,6 +2635,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
@@ -2629,7 +2649,9 @@ EXPLAIN
"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",
@@ -2642,6 +2664,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1;
@@ -2715,6 +2739,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
@@ -2727,7 +2753,9 @@ EXPLAIN
"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",
@@ -2740,6 +2768,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
@@ -2766,6 +2796,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
@@ -2778,7 +2810,9 @@ EXPLAIN
"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",
@@ -2791,6 +2825,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
@@ -2816,6 +2852,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -2827,7 +2865,9 @@ EXPLAIN
"filtered": 100,
"index_condition": "t1.a is not null",
"mrr_type": "Rowid-ordered scan"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
@@ -2841,6 +2881,8 @@ EXPLAIN
"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
where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1;
@@ -2874,6 +2916,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -2881,7 +2925,9 @@ EXPLAIN
"rows": 144,
"filtered": 100,
"attached_condition": "t1.a is not null"
}
},
{
"table": {
"table_name": "t2",
"access_type": "ref",
@@ -2895,6 +2941,8 @@ EXPLAIN
"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
where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1;
@@ -2922,6 +2970,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -2934,7 +2984,9 @@ EXPLAIN
"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",
@@ -2948,6 +3000,8 @@ EXPLAIN
"attached_condition": "octet_length(t2.f) = 1"
}
}
]
}
}
select * from t1,t2
where a = d and (a,2) in ((2,2),(7,7),(8,8)) and
@@ -3000,6 +3054,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "const",
@@ -3010,7 +3066,9 @@ EXPLAIN
"ref": ["const"],
"rows": 1,
"filtered": 100
}
},
{
"table": {
"table_name": "t1",
"access_type": "range",
@@ -3023,7 +3081,9 @@ EXPLAIN
"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",
@@ -3037,6 +3097,8 @@ EXPLAIN
"attached_condition": "octet_length(t2.f) = 1"
}
}
]
}
}
select * from t1,t2,t3
where id = 1 and a = d and

View File

@@ -77,6 +77,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -98,6 +100,8 @@ EXPLAIN
"attached_condition": "lineitem.l_quantity > 45"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
@@ -113,6 +117,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -143,6 +149,8 @@ ANALYZE
"attached_condition": "lineitem.l_quantity > 45"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
@@ -220,6 +228,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -233,6 +243,8 @@ EXPLAIN
"attached_condition": "lineitem.l_quantity > 45"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
@@ -248,6 +260,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -266,6 +280,8 @@ ANALYZE
"attached_condition": "lineitem.l_quantity > 45"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
@@ -346,6 +362,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -361,7 +379,9 @@ EXPLAIN
"rows": 98,
"filtered": 100,
"index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -383,6 +403,8 @@ EXPLAIN
"attached_condition": "orders.o_totalprice between 200000 and 230000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -401,6 +423,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -421,7 +445,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 100,
"index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -452,6 +478,8 @@ ANALYZE
"attached_condition": "orders.o_totalprice between 200000 and 230000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -484,6 +512,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -499,7 +529,9 @@ EXPLAIN
"rows": 98,
"filtered": 100,
"index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -513,6 +545,8 @@ EXPLAIN
"attached_condition": "orders.o_totalprice between 200000 and 230000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -531,6 +565,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -551,7 +587,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 100,
"index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -570,6 +608,8 @@ ANALYZE
"attached_condition": "orders.o_totalprice between 200000 and 230000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -604,6 +644,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -629,7 +671,9 @@ EXPLAIN
"filtered": 11.69025803,
"index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
"attached_condition": "lineitem.l_quantity > 45"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -651,6 +695,8 @@ EXPLAIN
"attached_condition": "orders.o_totalprice between 180000 and 230000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -671,6 +717,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -705,7 +753,9 @@ ANALYZE
"r_filtered": 100,
"index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
"attached_condition": "lineitem.l_quantity > 45"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -736,6 +786,8 @@ ANALYZE
"attached_condition": "orders.o_totalprice between 180000 and 230000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -776,6 +828,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -793,7 +847,9 @@ EXPLAIN
"filtered": 11.69025803,
"index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
"attached_condition": "lineitem.l_quantity > 45"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -807,6 +863,8 @@ EXPLAIN
"attached_condition": "orders.o_totalprice between 180000 and 230000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -827,6 +885,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -849,7 +909,9 @@ ANALYZE
"r_filtered": 11.76470588,
"index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
"attached_condition": "lineitem.l_quantity > 45"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -868,6 +930,8 @@ ANALYZE
"attached_condition": "orders.o_totalprice between 180000 and 230000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -906,6 +970,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -916,7 +982,9 @@ EXPLAIN
"rows": 69,
"filtered": 100,
"index_condition": "orders.o_totalprice between 200000 and 230000"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -943,6 +1011,8 @@ EXPLAIN
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -961,6 +1031,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -976,7 +1048,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 100,
"index_condition": "orders.o_totalprice between 200000 and 230000"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1012,6 +1086,8 @@ ANALYZE
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -1070,6 +1146,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1080,7 +1158,9 @@ EXPLAIN
"rows": 69,
"filtered": 100,
"index_condition": "orders.o_totalprice between 200000 and 230000"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1099,6 +1179,8 @@ EXPLAIN
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -1117,6 +1199,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1132,7 +1216,9 @@ ANALYZE
"filtered": 100,
"r_filtered": 100,
"index_condition": "orders.o_totalprice between 200000 and 230000"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1156,6 +1242,8 @@ ANALYZE
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -1225,6 +1313,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -1242,7 +1332,9 @@ EXPLAIN
"filtered": 0.566194832,
"index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -1256,6 +1348,8 @@ EXPLAIN
"attached_condition": "orders.o_totalprice between 200000 and 250000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT l_shipdate, l_receiptdate, o_totalprice
FROM orders, lineitem
@@ -1278,6 +1372,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -1300,7 +1396,9 @@ ANALYZE
"r_filtered": 38.88888889,
"index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -1319,6 +1417,8 @@ ANALYZE
"attached_condition": "orders.o_totalprice between 200000 and 250000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for SELECT l_shipdate, l_receiptdate, o_totalprice
FROM orders, lineitem
@@ -1347,6 +1447,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -1364,7 +1466,9 @@ EXPLAIN
"filtered": 0.566194832,
"index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -1378,6 +1482,8 @@ EXPLAIN
"attached_condition": "orders.o_totalprice between 200000 and 250000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT l_shipdate, l_receiptdate, o_totalprice
FROM orders, lineitem
@@ -1400,6 +1506,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -1422,7 +1530,9 @@ ANALYZE
"r_filtered": 38.88888889,
"index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -1441,6 +1551,8 @@ ANALYZE
"attached_condition": "orders.o_totalprice between 200000 and 250000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for SELECT l_shipdate, l_receiptdate, o_totalprice
FROM orders, lineitem
@@ -1476,6 +1588,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1487,7 +1601,9 @@ EXPLAIN
"filtered": 3.200000048,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1506,6 +1622,8 @@ EXPLAIN
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM orders, lineitem
@@ -1528,6 +1646,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1544,7 +1664,9 @@ ANALYZE
"r_filtered": 2.43902439,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1568,6 +1690,8 @@ ANALYZE
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM orders, lineitem
@@ -1599,6 +1723,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1610,7 +1736,9 @@ EXPLAIN
"filtered": 3.200000048,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1629,6 +1757,8 @@ EXPLAIN
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM orders, lineitem
@@ -1651,6 +1781,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1667,7 +1799,9 @@ ANALYZE
"r_filtered": 2.43902439,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1691,6 +1825,8 @@ ANALYZE
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM orders, lineitem
@@ -1725,6 +1861,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1741,7 +1879,9 @@ EXPLAIN
"filtered": "REPLACED",
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1760,6 +1900,8 @@ EXPLAIN
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM v1, lineitem
@@ -1782,6 +1924,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1803,7 +1947,9 @@ ANALYZE
"r_filtered": 2.43902439,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1827,6 +1973,8 @@ ANALYZE
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM v1, lineitem
@@ -1858,6 +2006,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1874,7 +2024,9 @@ EXPLAIN
"filtered": "REPLACED",
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1893,6 +2045,8 @@ EXPLAIN
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM v1, lineitem
@@ -1915,6 +2069,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1936,7 +2092,9 @@ ANALYZE
"r_filtered": 2.43902439,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1960,6 +2118,8 @@ ANALYZE
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM v1, lineitem
@@ -2093,13 +2253,17 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 101,
"filtered": 100,
"attached_condition": "t2.a2 <> t2.pk2 and t2.a2 is not null"
}
},
{
"table": {
"table_name": "t1",
"access_type": "eq_ref",
@@ -2119,11 +2283,15 @@ EXPLAIN
"rows": 1,
"filtered": 87,
"attached_condition": "t1.b1 <= (subquery#2)"
},
}
}
],
"subqueries": [
{
"query_block": {
"select_id": 2,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
@@ -2136,6 +2304,8 @@ EXPLAIN
"index_condition": "t2.pk2 <= 1"
}
}
]
}
}
]
}

View File

@@ -80,6 +80,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -101,6 +103,8 @@ EXPLAIN
"attached_condition": "lineitem.l_quantity > 45"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
@@ -116,6 +120,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -146,6 +152,8 @@ ANALYZE
"attached_condition": "lineitem.l_quantity > 45"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
@@ -223,6 +231,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -236,6 +246,8 @@ EXPLAIN
"attached_condition": "lineitem.l_quantity > 45"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
@@ -251,6 +263,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -269,6 +283,8 @@ ANALYZE
"attached_condition": "lineitem.l_quantity > 45"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
@@ -349,6 +365,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -365,7 +383,9 @@ EXPLAIN
"filtered": 100,
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'",
"using_index": true
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -379,6 +399,8 @@ EXPLAIN
"attached_condition": "orders.o_totalprice between 200000 and 230000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -397,6 +419,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -418,7 +442,9 @@ ANALYZE
"r_filtered": 100,
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'",
"using_index": true
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -437,6 +463,8 @@ ANALYZE
"attached_condition": "orders.o_totalprice between 200000 and 230000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -469,6 +497,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -485,7 +515,9 @@ EXPLAIN
"filtered": 100,
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'",
"using_index": true
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -499,6 +531,8 @@ EXPLAIN
"attached_condition": "orders.o_totalprice between 200000 and 230000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -517,6 +551,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -538,7 +574,9 @@ ANALYZE
"r_filtered": 100,
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'",
"using_index": true
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -557,6 +595,8 @@ ANALYZE
"attached_condition": "orders.o_totalprice between 200000 and 230000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -591,6 +631,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -616,7 +658,9 @@ EXPLAIN
"filtered": 10.07493782,
"index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
"attached_condition": "lineitem.l_quantity > 45"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -630,6 +674,8 @@ EXPLAIN
"attached_condition": "orders.o_totalprice between 180000 and 230000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -650,6 +696,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -684,7 +732,9 @@ ANALYZE
"r_filtered": 100,
"index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
"attached_condition": "lineitem.l_quantity > 45"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -703,6 +753,8 @@ ANALYZE
"attached_condition": "orders.o_totalprice between 180000 and 230000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -743,6 +795,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -754,7 +808,9 @@ EXPLAIN
"filtered": 100,
"attached_condition": "orders.o_totalprice between 180000 and 230000",
"using_index": true
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -774,6 +830,8 @@ EXPLAIN
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30' and lineitem.l_quantity > 45"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -794,6 +852,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -810,7 +870,9 @@ ANALYZE
"r_filtered": 100,
"attached_condition": "orders.o_totalprice between 180000 and 230000",
"using_index": true
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -835,6 +897,8 @@ ANALYZE
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30' and lineitem.l_quantity > 45"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -873,6 +937,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -884,7 +950,9 @@ EXPLAIN
"filtered": 100,
"attached_condition": "orders.o_totalprice between 200000 and 230000",
"using_index": true
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -903,6 +971,8 @@ EXPLAIN
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -921,6 +991,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -937,7 +1009,9 @@ ANALYZE
"r_filtered": 100,
"attached_condition": "orders.o_totalprice between 200000 and 230000",
"using_index": true
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -961,6 +1035,8 @@ ANALYZE
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -1019,6 +1095,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1030,7 +1108,9 @@ EXPLAIN
"filtered": 100,
"attached_condition": "orders.o_totalprice between 200000 and 230000",
"using_index": true
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1049,6 +1129,8 @@ EXPLAIN
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -1067,6 +1149,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1083,7 +1167,9 @@ ANALYZE
"r_filtered": 100,
"attached_condition": "orders.o_totalprice between 200000 and 230000",
"using_index": true
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1107,6 +1193,8 @@ ANALYZE
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -1176,6 +1264,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -1193,7 +1283,9 @@ EXPLAIN
"filtered": 0.566194832,
"index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -1207,6 +1299,8 @@ EXPLAIN
"attached_condition": "orders.o_totalprice between 200000 and 250000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT l_shipdate, l_receiptdate, o_totalprice
FROM orders, lineitem
@@ -1229,6 +1323,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -1251,7 +1347,9 @@ ANALYZE
"r_filtered": 38.88888889,
"index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -1270,6 +1368,8 @@ ANALYZE
"attached_condition": "orders.o_totalprice between 200000 and 250000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for SELECT l_shipdate, l_receiptdate, o_totalprice
FROM orders, lineitem
@@ -1298,6 +1398,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -1315,7 +1417,9 @@ EXPLAIN
"filtered": 0.566194832,
"index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -1329,6 +1433,8 @@ EXPLAIN
"attached_condition": "orders.o_totalprice between 200000 and 250000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT l_shipdate, l_receiptdate, o_totalprice
FROM orders, lineitem
@@ -1351,6 +1457,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
@@ -1373,7 +1481,9 @@ ANALYZE
"r_filtered": 38.88888889,
"index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
}
},
{
"table": {
"table_name": "orders",
"access_type": "eq_ref",
@@ -1392,6 +1502,8 @@ ANALYZE
"attached_condition": "orders.o_totalprice between 200000 and 250000"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for SELECT l_shipdate, l_receiptdate, o_totalprice
FROM orders, lineitem
@@ -1427,6 +1539,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1438,7 +1552,9 @@ EXPLAIN
"filtered": 3.333333254,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1457,6 +1573,8 @@ EXPLAIN
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM orders, lineitem
@@ -1479,6 +1597,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1495,7 +1615,9 @@ ANALYZE
"r_filtered": 2.43902439,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1519,6 +1641,8 @@ ANALYZE
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM orders, lineitem
@@ -1550,6 +1674,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1561,7 +1687,9 @@ EXPLAIN
"filtered": 3.333333254,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1580,6 +1708,8 @@ EXPLAIN
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM orders, lineitem
@@ -1602,6 +1732,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1618,7 +1750,9 @@ ANALYZE
"r_filtered": 2.43902439,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1642,6 +1776,8 @@ ANALYZE
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM orders, lineitem
@@ -1676,6 +1812,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1692,7 +1830,9 @@ EXPLAIN
"filtered": "REPLACED",
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1711,6 +1851,8 @@ EXPLAIN
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM v1, lineitem
@@ -1733,6 +1875,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1754,7 +1898,9 @@ ANALYZE
"r_filtered": 2.43902439,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1778,6 +1924,8 @@ ANALYZE
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=on' for SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM v1, lineitem
@@ -1809,6 +1957,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1825,7 +1975,9 @@ EXPLAIN
"filtered": "REPLACED",
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1844,6 +1996,8 @@ EXPLAIN
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM v1, lineitem
@@ -1866,6 +2020,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "orders",
"access_type": "range",
@@ -1887,7 +2043,9 @@ ANALYZE
"r_filtered": 2.43902439,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
}
},
{
"table": {
"table_name": "lineitem",
"access_type": "ref",
@@ -1911,6 +2069,8 @@ ANALYZE
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
}
]
}
}
set statement optimizer_switch='rowid_filter=off' for SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM v1, lineitem
@@ -2044,13 +2204,17 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 101,
"filtered": 100,
"attached_condition": "t2.a2 <> t2.pk2 and t2.a2 is not null"
}
},
{
"table": {
"table_name": "t1",
"access_type": "eq_ref",
@@ -2070,11 +2234,15 @@ EXPLAIN
"rows": 1,
"filtered": 87,
"attached_condition": "t1.b1 <= (subquery#2)"
},
}
}
],
"subqueries": [
{
"query_block": {
"select_id": 2,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "range",
@@ -2087,6 +2255,8 @@ EXPLAIN
"index_condition": "t2.pk2 <= 1"
}
}
]
}
}
]
}
@@ -2200,6 +2370,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ref",
@@ -2222,11 +2394,15 @@ EXPLAIN
"attached_condition": "t1.f2 is null and (t1.f2 between 'a' and 'z' or t1.f1 = 'a')"
}
}
]
}
},
{
"query_block": {
"select_id": 2,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ref",
@@ -2249,6 +2425,8 @@ EXPLAIN
"attached_condition": "t1.f2 is null and (t1.f2 between 'a' and 'z' or t1.f1 = 'a')"
}
}
]
}
}
]
}
@@ -2878,22 +3056,28 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "index_merge",
"possible_keys": ["PRIMARY", "acli_rid", "acli_tp"],
"key_length": "2,767",
"index_merge": {
"intersect": {
"intersect": [
{
"range": {
"key": "acli_tp",
"used_key_parts": ["tp"]
}
},
{
"range": {
"key": "acli_rid",
"used_key_parts": ["rid"]
}
}
]
},
"r_loops": 1,
"rows": 2,
@@ -2904,7 +3088,9 @@ ANALYZE
"r_filtered": 100,
"attached_condition": "t.tp = 121 and t.rid = 'B5FCC8C7111E4E3CBC21AAF5012F59C2'",
"using_index": true
}
},
{
"block-nl-join": {
"table": {
"table_name": "a",
@@ -2928,7 +3114,9 @@ ANALYZE
"mrr_type": "Rowid-ordered scan",
"attached_condition": "a.atp = 1",
"r_filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "fi",
@@ -2966,6 +3154,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
set optimizer_switch=@save_optimizer_switch;
set join_cache_level=@save_join_cache_level;

View File

@@ -571,6 +571,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -578,11 +580,15 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 8,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
@@ -597,6 +603,8 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -604,6 +612,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
@@ -618,6 +628,8 @@ EXPLAIN
"query_block": {
"select_id": 4,
"operation": "INTERSECT",
"nested_loop": [
{
"table": {
"table_name": "<derived5>",
"access_type": "ALL",
@@ -632,6 +644,8 @@ EXPLAIN
{
"query_block": {
"select_id": 5,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -639,11 +653,15 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 6,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -651,10 +669,11 @@ EXPLAIN
"filtered": 100
}
}
}
]
}
}
]
}
}
}
}
@@ -662,14 +681,21 @@ EXPLAIN
]
}
}
]
}
}
}
}
}
]
}
},
{
"query_block": {
"select_id": 7,
"operation": "EXCEPT",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
@@ -677,11 +703,15 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 9,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -689,11 +719,15 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 10,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
@@ -701,17 +735,23 @@ EXPLAIN
"filtered": 100
}
}
]
}
},
{
"query_block": {
"select_id": 11,
"operation": "EXCEPT",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "t2",
@@ -724,18 +764,24 @@ EXPLAIN
"join_type": "BNL"
}
}
]
}
},
{
"query_block": {
"select_id": 12,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 5,
"filtered": 100,
"attached_condition": "t1.a < 4"
}
},
{
"block-nl-join": {
"table": {
"table_name": "t2",
@@ -748,11 +794,15 @@ EXPLAIN
"join_type": "BNL"
}
}
]
}
},
{
"query_block": {
"select_id": 13,
"operation": "UNION",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
@@ -760,6 +810,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
]
}

View File

@@ -48,6 +48,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -58,7 +60,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
}
}
],
"subqueries": [
{
"expression_cache": {
@@ -68,6 +72,8 @@ ANALYZE
"select_id": 2,
"r_loops": 4,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -81,6 +87,8 @@ ANALYZE
"attached_condition": "t1.b = t2.c"
}
}
]
}
}
}
]
@@ -94,6 +102,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -104,7 +114,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
}
}
],
"subqueries": [
{
"expression_cache": {
@@ -122,6 +134,8 @@ ANALYZE
"select_id": 3,
"r_loops": 4,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -135,6 +149,8 @@ ANALYZE
"attached_condition": "t1.b = t2.c"
}
}
]
}
},
{
"query_block": {
@@ -158,6 +174,8 @@ ANALYZE
"select_id": 2,
"r_loops": 4,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -171,6 +189,8 @@ ANALYZE
"attached_condition": "t1.b = t2.c"
}
}
]
}
}
}
]
@@ -182,18 +202,24 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
},
}
}
],
"subqueries": [
{
"expression_cache": {
"state": "uninitialized",
"query_block": {
"select_id": 2,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -202,6 +228,8 @@ EXPLAIN
"attached_condition": "t1.b = t2.c"
}
}
]
}
}
}
]
@@ -213,12 +241,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 10,
"filtered": 100
},
}
}
],
"subqueries": [
{
"expression_cache": {
@@ -231,6 +263,8 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -239,6 +273,8 @@ EXPLAIN
"attached_condition": "t1.b = t2.c"
}
}
]
}
},
{
"query_block": {
@@ -259,6 +295,8 @@ EXPLAIN
"state": "uninitialized",
"query_block": {
"select_id": 2,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
@@ -267,6 +305,8 @@ EXPLAIN
"attached_condition": "t1.b = t2.c"
}
}
]
}
}
}
]

View File

@@ -7404,27 +7404,37 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"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))",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "system",
"rows": 1,
"filtered": 100
},
}
}
],
"subqueries": [
{
"query_block": {
"select_id": 3,
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
@@ -7433,6 +7443,8 @@ EXPLAIN
"attached_condition": "1 = t3.c"
}
}
]
}
}
]
}

View File

@@ -1403,12 +1403,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t0.a"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
@@ -1416,6 +1420,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1434,12 +1440,16 @@ EXPLAIN
"filesort": {
"sort_key": "t1.a",
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "sum(t1.b)"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1447,6 +1457,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1463,12 +1475,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "sum(t1.b)"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1476,6 +1492,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1497,12 +1515,16 @@ EXPLAIN
"filesort": {
"sort_key": "t1.b",
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.b"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1510,6 +1532,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1642,12 +1666,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.c, t1.a"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1655,6 +1683,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1668,12 +1698,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.a"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1681,6 +1715,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1694,12 +1730,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.c, t1.a"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1707,6 +1747,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1720,12 +1762,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.c, t1.a"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1733,6 +1779,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1776,12 +1824,16 @@ EXPLAIN
"filesort": {
"sort_key": "row_number() over ( order by t1.s1,t1.s2) desc",
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.s1, t1.s2"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1789,6 +1841,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1929,12 +1983,16 @@ EXPLAIN
"select_id": 1,
"duplicate_removal": {
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.part_id, t1.a"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1942,6 +2000,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -2102,12 +2162,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.a, t1.pk"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -2115,6 +2179,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -2163,12 +2229,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.a, t1.b"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -2176,6 +2246,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -3755,7 +3827,8 @@ ANALYZE
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "`row_number() OVER()`",
"r_loops": 1,
@@ -3765,8 +3838,11 @@ ANALYZE
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,rowid"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -3779,6 +3855,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
}
}

View File

@@ -37,12 +37,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "pk"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "index",
@@ -54,6 +58,8 @@ EXPLAIN
"using_index": true
}
}
]
}
}
}
}
@@ -63,12 +69,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "`row_number() over ()`"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "index",
@@ -80,6 +90,8 @@ EXPLAIN
"using_index": true
}
}
]
}
}
}
}

View File

@@ -1409,12 +1409,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t0.a"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
@@ -1422,6 +1426,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1440,12 +1446,16 @@ EXPLAIN
"filesort": {
"sort_key": "t1.a",
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "sum(t1.b)"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1453,6 +1463,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1469,12 +1481,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "sum(t1.b)"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1482,6 +1498,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1503,12 +1521,16 @@ EXPLAIN
"filesort": {
"sort_key": "t1.b",
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.b"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1516,6 +1538,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1648,12 +1672,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.c, t1.a"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1661,6 +1689,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1674,12 +1704,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.a"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1687,6 +1721,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1700,12 +1736,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.c, t1.a"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1713,6 +1753,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1726,12 +1768,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.c, t1.a"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1739,6 +1785,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1782,12 +1830,16 @@ EXPLAIN
"filesort": {
"sort_key": "row_number() over ( order by t1.s1,t1.s2) desc",
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.s1, t1.s2"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1795,6 +1847,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -1935,12 +1989,16 @@ EXPLAIN
"select_id": 1,
"duplicate_removal": {
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.part_id, t1.a"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -1948,6 +2006,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -2108,12 +2168,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.a, t1.pk"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -2121,6 +2185,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -2169,12 +2235,16 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "t1.a, t1.b"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -2182,6 +2252,8 @@ EXPLAIN
"filtered": 100
}
}
]
}
}
}
}
@@ -3761,7 +3833,8 @@ ANALYZE
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"window_functions_computation": {
"sorts": {
"sorts": [
{
"filesort": {
"sort_key": "`row_number() OVER()`",
"r_loops": 1,
@@ -3771,8 +3844,11 @@ ANALYZE
"r_buffer_size": "REPLACED",
"r_sort_mode": "sort_key,rowid"
}
},
}
],
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
@@ -3785,6 +3861,8 @@ ANALYZE
"r_filtered": 100
}
}
]
}
}
}
}

View File

@@ -157,12 +157,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 7,
"filtered": 100
}
},
{
"table": {
"table_name": "<derived2>",
"access_type": "ref",
@@ -183,6 +187,8 @@ EXPLAIN
}
}
}
]
}
}
ANALYZE
SELECT *
@@ -221,6 +227,8 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
@@ -231,7 +239,9 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
},
{
"table": {
"table_name": "<derived2>",
"access_type": "ref",
@@ -257,6 +267,8 @@ ANALYZE
}
}
}
]
}
}
SELECT t.id, federated.t3.name
FROM federated.t3,
@@ -346,12 +358,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t5",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
},
{
"block-nl-join": {
"table": {
"table_name": "<derived2>",
@@ -372,6 +388,8 @@ EXPLAIN
}
}
}
]
}
}
drop table t5;
DROP TABLE federated.t1, federated.t2, federated.t3, federated.t4;

View File

@@ -211,6 +211,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "tt",
"access_type": "ALL",
@@ -219,6 +221,8 @@ EXPLAIN
"table_function": "json_table"
}
}
]
}
}
explain select * from
json_table('[{"a": 1, "b": [11,111]}, {"a": 2, "b": [22,222]}]', '$[*]' COLUMNS( a INT PATH '$.a')) as tt;

View File

@@ -189,6 +189,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "tt",
"access_type": "ALL",
@@ -197,6 +199,8 @@ EXPLAIN
"table_function": "json_table"
}
}
]
}
}
select * from
json_table(

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);
{
Json_writer_array loop(writer, "nested_loop");
for (uint i=0; i< n_join_tabs; i++)
{
if (join_tabs[i]->start_dups_weedout)
writer->add_member("duplicates_removal").start_object();
{
writer->start_object();
writer->add_member("duplicates_removal");
}
join_tabs[i]->print_explain_json(query, writer, is_analyze);
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,6 +47,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "range",
@@ -60,6 +62,8 @@ EXPLAIN
"attached_condition": "t3.kp2 like '%foo%'"
}
}
]
}
}
# Check that we handle the case where out-of-range is encountered sooner
# than matched index condition

View File

@@ -47,6 +47,8 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "range",
@@ -60,6 +62,8 @@ EXPLAIN
"attached_condition": "t3.kp2 like '%foo%'"
}
}
]
}
}
# Check that we handle the case where out-of-range is encountered sooner
# than matched index condition