1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-29179 Condition pushdown from HAVING into WHERE is not shown in optimizer trace

JOIN::optimize_inner(), Condition pushdown from HAVING into WHERE
	  not shown in optimizer trace.
This commit is contained in:
Rex
2023-02-17 08:28:38 +12:00
committed by Oleksandr Byelkin
parent d816a5ca32
commit 36f51d9748
3 changed files with 34 additions and 0 deletions

View File

@ -9041,5 +9041,24 @@ JS
drop table t1,t2,t3,t10,t11;
set optimizer_trace=DEFAULT;
#
# MDEV-29179 Condition pushdown from HAVING into WHERE is not shown in optimizer trace
#
CREATE TABLE t1 (a INT, b VARCHAR(1), KEY (a), KEY(b,a)) ENGINE=MEMORY;
INSERT INTO t1 VALUES (4,'n'),(1,'h'),(NULL,'w');
SET optimizer_trace= 'enabled=on';
SELECT b, a FROM t1 WHERE b <> 'p' OR a = 4 GROUP BY b, a HAVING a <= 7;
b a
h 1
n 4
SELECT json_detailed(json_extract(trace, '$**.steps[*].join_optimization.steps[*].condition_pushdown_from_having') ), JSON_VALID(trace) FROM information_schema.optimizer_trace;
json_detailed(json_extract(trace, '$**.steps[*].join_optimization.steps[*].condition_pushdown_from_having') ) JSON_VALID(trace)
[
{
"conds": "(t1.b <> 'p' or multiple equal(4, t1.a)) and t1.a <= 7",
"having": null
}
] 1
DROP TABLE t1;
#
# End of 10.4 tests
#