[MDEV-29298] INSERT ... SELECT Does not produce an optimizer trace Created: 2022-08-11  Updated: 2024-01-15  Resolved: 2024-01-13

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.5.24, 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3

Type: Bug Priority: Major
Reporter: Sergei Petrunia Assignee: Oleg Smirnov
Resolution: Fixed Votes: 0
Labels: optimizer_trace


 Description   

INSERT ... SELECT statement does not produce optimizer trace:

create table t100 (a int, b int);
create table t101 (a int, b int);
insert into t101 select seq, seq from seq_1_to_1000;
set optimizer_trace=1;
insert into t100 select * from t101 where a<= b and a >4;

MariaDB [test]> select * from information_schema.optimizer_trace\G
Empty set (0.002 sec)

It should produce it.



 Comments   
Comment by Oleg Smirnov [ 2023-07-06 ]

Please review bb-10.5-mdev-29298.

Comment by Sergei Petrunia [ 2024-01-11 ]

The patch itself is ok. The testcase seems to large. The contents of the optimizer trace are actually irrelevant.
Please change

+select * from information_schema.optimizer_trace;

to something like

+select QUERY, LENGTH(trace)>1 from information_schema.optimizer_trace;

Ok to push after this is addressed.

Comment by Oleg Smirnov [ 2024-01-13 ]

Addressed the comment and pushed to 10.5

Generated at Thu Feb 08 10:07:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.