The best I could do is shown in the [test case][1] that is included with the fix. > ~~~~ CREATE TABLE t0(a PRIMARY KEY,b TEXT AS ('2') UNIQUE); SELECT * FROM t0 AS x JOIN t0 AS y WHERE x.b='2' AND (y.a=2 OR (x.b LIKE '2*' AND y.a=x.b)); ~~~~ So I was able to take off the "WITHOUT ROWID" from the table definition, and remove the "likely()" term from the WHERE clause. I wasn't able to simplify beyond that. The problem arose for a tricky and unlikely interaction between: * The LIKE optimizer * The OR optimizer * Generated columns [1]: src:/fdiff?v1=6912c4280d0ad26d&v2=1b63f8c00154e587