Documentation states: The LIKE optimization is not attempted if there is an EXCEPT phrase on the LIKE operator.
However you can't really slap EXCEPT (a kind of set difference join) on top of LIKE. Instead, what is meant is that ESCAPE modifier disables LIKE optimisation. And that's really the case too: sqlite> explain query plan select * from foo where bar LIKE '/test/1m%'; 0|0|0|SEARCH TABLE foo USING INDEX foo_bar_idx (bar>? AND bar<?) sqlite> explain query plan select * from foo where bar LIKE '/test/1m%' ESCAPE '|'; 0|0|0|SCAN TABLE foo OT, it's really rather sad that LIKE query optimisation doesn't support ESCAPE, as at least underscore "_" is in fact pretty common character, thus most users should ESCAPE. Thanks, Dima Tisnek _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users