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

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

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

MDEV-27036: duplicated keys in best_access_path

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

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

View File

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