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

MDEV-26301: Split optimization refills: Optimizer Trace coverage

Add Optimizer Trace printouts.
This commit is contained in:
Sergei Petrunia
2023-05-03 13:49:32 +03:00
committed by Oleksandr Byelkin
parent ce7ffe61d8
commit ed3e6f66a2
4 changed files with 245 additions and 13 deletions

View File

@ -696,6 +696,76 @@ SET optimizer_trace=DEFAULT;
DROP VIEW v;
DROP TABLE t;
--echo #
--echo # MDEV-26301: Split optimization improvements: Optimizer Trace coverage
--echo #
# 5 values
create table t1(a int, b int);
insert into t1 select seq,seq from seq_1_to_5;
# 5 value groups of size 2 each
create table t2(a int, b int, key(a));
insert into t2
select A.seq,B.seq from seq_1_to_25 A, seq_1_to_2 B;
# 5 value groups of size 3 each
create table t3(a int, b int, key(a));
insert into t3
select A.seq,B.seq from seq_1_to_5 A, seq_1_to_3 B;
analyze table t1,t2,t3 persistent for all;
create table t10 (
grp_id int,
col1 int,
key(grp_id)
);
# 100 groups of 100 values each
insert into t10
select
A.seq,
B.seq
from
seq_1_to_100 A,
seq_1_to_100 B;
# and X10 multiplier
create table t11 (
col1 int,
col2 int
);
insert into t11
select A.seq, A.seq from seq_1_to_10 A;
analyze table t10,t11 persistent for all;
set optimizer_trace=1;
explain
select * from
(
(t1 left join t2 on t2.a=t1.b)
left join t3 on t3.a=t1.b
) left join (select grp_id, count(*)
from t10 left join t11 on t11.col1=t10.col1
group by grp_id) T on T.grp_id=t1.b;
select json_detailed(json_extract(trace, '$**.check_split_materialized')) as JS
from information_schema.optimizer_trace;
select
json_detailed(
json_remove(
json_extract(trace, '$**.choose_best_splitting')
, '$[0].split_plan_search[0]'
)
) as JS
from information_schema.optimizer_trace;
drop table t1,t2,t3,t10,t11;
set optimizer_trace=DEFAULT;
--echo #
--echo # End of 10.4 tests
--echo #