Hi Rex, I am looking at the latest commit: commit 9eba044b9710bbdd8195e887cfdd4d62233942ca (HEAD -> bb-MDEV-21092-21095-29997-optimizer-trace-updates, Author: Rex <rex.johnston@mariadb.com> Date: Fri Dec 2 16:46:54 2022 +1200 MDEV-21092,MDEV-21095,MDEV-29997: Optimizer Trace for index condition pushdown, partition pruning, exists-to-in Add Optimizer Tracing for: - Index Condition Pushdown - Partition Pruning - Exists-to-IN optimization and trying this testcase: == testcase == --source include/have_sequence.inc create table t1 ( a int, b int, key(a) ); insert into t1 select seq, seq from seq_1_to_10000; --optimizer_trace explain format=json select * from t1 where a < 20 and (a+1<a+2) and b=3333; drop table t1; == Testcase ends == In the output I see: == Output == { "make_join_readinfo": [ { "table": "t1", "index_condition": "t1.b = 3333" // WRONG-1 } ] } ] } }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { "table": "t1", "attached_condition": "t1.b = 3333", "index_condition": "t1.a < 20 and t1.a + 1 < t1.a + 2" } ] } }, == Output ends == note the line marked "WRONG-1". I also think some of the recent changes in the patch go in the wrong direction. Let me take over, I think I'll make a patch to fix both. BR Sergei -- Sergei Petrunia, Software Developer MariaDB Corporation | Skype: sergefp | Blog: http://petrunia.net