mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.6 into 10.11
This commit is contained in:
@@ -101,8 +101,6 @@ ANALYZE
|
||||
}
|
||||
}
|
||||
# "Partial match" is used due to NOT IN
|
||||
# Force rowid-merge partial partial matching
|
||||
set @@optimizer_switch="partial_match_rowid_merge=on,partial_match_table_scan=off";
|
||||
analyze format=json select * from t1 where a not in (select b from t2);
|
||||
ANALYZE
|
||||
{
|
||||
@@ -133,71 +131,7 @@ ANALYZE
|
||||
"subqueries": [
|
||||
{
|
||||
"materialization": {
|
||||
"r_strategy": "index_lookup;array merge for partial match",
|
||||
"r_loops": 4,
|
||||
"r_index_lookups": 3,
|
||||
"r_partial_matches": 1,
|
||||
"r_partial_match_buffer_size": "REPLACED",
|
||||
"r_partial_match_array_sizes": ["2"],
|
||||
"query_block": {
|
||||
"select_id": 2,
|
||||
"r_loops": 1,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
"table_name": "t2",
|
||||
"access_type": "ALL",
|
||||
"r_loops": 1,
|
||||
"rows": 2,
|
||||
"r_rows": 2,
|
||||
"r_table_time_ms": "REPLACED",
|
||||
"r_other_time_ms": "REPLACED",
|
||||
"r_engine_stats": REPLACED,
|
||||
"filtered": 100,
|
||||
"r_filtered": 100
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
# Force table scan partial matching
|
||||
set @@optimizer_switch="partial_match_rowid_merge=off,partial_match_table_scan=on";
|
||||
analyze format=json select * from t1 where a not in (select b from t2);
|
||||
ANALYZE
|
||||
{
|
||||
"query_optimization": {
|
||||
"r_total_time_ms": "REPLACED"
|
||||
},
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"r_loops": 1,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
"table_name": "t1",
|
||||
"access_type": "ALL",
|
||||
"r_loops": 1,
|
||||
"rows": 4,
|
||||
"r_rows": 4,
|
||||
"r_table_time_ms": "REPLACED",
|
||||
"r_other_time_ms": "REPLACED",
|
||||
"r_engine_stats": REPLACED,
|
||||
"filtered": 100,
|
||||
"r_filtered": 50,
|
||||
"attached_condition": "!<in_optimizer>(t1.a,t1.a in (subquery#2))"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subqueries": [
|
||||
{
|
||||
"materialization": {
|
||||
"r_strategy": "index_lookup;full scan for partial match",
|
||||
"r_strategy": "null-aware index_lookup",
|
||||
"r_loops": 4,
|
||||
"r_index_lookups": 3,
|
||||
"r_partial_matches": 1,
|
||||
@@ -266,7 +200,7 @@ ANALYZE
|
||||
"subqueries": [
|
||||
{
|
||||
"materialization": {
|
||||
"r_strategy": "index_lookup;full scan for partial match",
|
||||
"r_strategy": "null-aware index_lookup",
|
||||
"r_loops": 4,
|
||||
"r_index_lookups": 3,
|
||||
"r_partial_matches": 1,
|
||||
@@ -298,7 +232,6 @@ ANALYZE
|
||||
}
|
||||
}
|
||||
}
|
||||
set @@optimizer_switch="partial_match_rowid_merge=on,partial_match_table_scan=off";
|
||||
analyze format=json select a from t1 group by a not in (select b from t2);
|
||||
ANALYZE
|
||||
{
|
||||
@@ -337,12 +270,10 @@ ANALYZE
|
||||
"subqueries": [
|
||||
{
|
||||
"materialization": {
|
||||
"r_strategy": "index_lookup;array merge for partial match",
|
||||
"r_strategy": "null-aware index_lookup",
|
||||
"r_loops": 4,
|
||||
"r_index_lookups": 3,
|
||||
"r_partial_matches": 1,
|
||||
"r_partial_match_buffer_size": "REPLACED",
|
||||
"r_partial_match_array_sizes": ["2"],
|
||||
"query_block": {
|
||||
"select_id": 2,
|
||||
"r_loops": 1,
|
||||
@@ -371,7 +302,6 @@ ANALYZE
|
||||
}
|
||||
}
|
||||
}
|
||||
set @@optimizer_switch="partial_match_rowid_merge=on,partial_match_table_scan=on";
|
||||
# Subselect in ORDER BY
|
||||
analyze format=json select a from t1 order by a in (select b from t2);
|
||||
ANALYZE
|
||||
@@ -414,7 +344,7 @@ ANALYZE
|
||||
"subqueries": [
|
||||
{
|
||||
"materialization": {
|
||||
"r_strategy": "index_lookup;full scan for partial match",
|
||||
"r_strategy": "null-aware index_lookup",
|
||||
"r_loops": 4,
|
||||
"r_index_lookups": 3,
|
||||
"r_partial_matches": 1,
|
||||
@@ -475,7 +405,7 @@ ANALYZE
|
||||
"subqueries": [
|
||||
{
|
||||
"materialization": {
|
||||
"r_strategy": "index_lookup;full scan for partial match",
|
||||
"r_strategy": "null-aware index_lookup",
|
||||
"r_loops": 4,
|
||||
"r_index_lookups": 3,
|
||||
"r_partial_matches": 1,
|
||||
@@ -652,7 +582,7 @@ ANALYZE
|
||||
"subqueries": [
|
||||
{
|
||||
"materialization": {
|
||||
"r_strategy": "index_lookup;full scan for partial match",
|
||||
"r_strategy": "null-aware index_lookup",
|
||||
"r_loops": 4,
|
||||
"r_index_lookups": 3,
|
||||
"query_block": {
|
||||
@@ -763,6 +693,7 @@ create table t1 (a1 char(1), a2 char(1));
|
||||
insert into t1 values (null, 'b');
|
||||
create table t2 (b1 char(1), b2 char(2));
|
||||
insert into t2 values ('a','b'), ('c', 'd'), (null, 'e'), ('f', 'g');
|
||||
# Force rowid-merge partial matching
|
||||
set @@optimizer_switch="partial_match_rowid_merge=on,partial_match_table_scan=off";
|
||||
explain format=json select * from t1 where (a1, a2) not in (select b1, b2 from t2);
|
||||
EXPLAIN
|
||||
@@ -860,6 +791,7 @@ ANALYZE
|
||||
]
|
||||
}
|
||||
}
|
||||
# Force table scan partial matching
|
||||
set @@optimizer_switch="partial_match_rowid_merge=off,partial_match_table_scan=on";
|
||||
analyze format=json select * from t1 where (a1, a2) not in (select b1, b2 from t2);
|
||||
ANALYZE
|
||||
|
Reference in New Issue
Block a user