Re: [sqlite] Index on expression optimization

2019-02-15 Thread Richard Hipp
On 2/15/19, Rowan Worth wrote: > On Fri, 15 Feb 2019 at 16:13, Wout Mertens wrote: > >> sqlite> create index b on t(b) where b is not null; >> sqlite> explain query plan select b from t where b is not null; >> QUERY PLAN >> `--SCAN TABLE t USING COVERING INDEX b >> sqlite> explain query plan

Re: [sqlite] Index on expression optimization

2019-02-15 Thread Rowan Worth
On Fri, 15 Feb 2019 at 16:13, Wout Mertens wrote: > sqlite> create index b on t(b) where b is not null; > sqlite> explain query plan select b from t where b is not null; > QUERY PLAN > `--SCAN TABLE t USING COVERING INDEX b > sqlite> explain query plan select b from t where (b is not null)=1; >

[sqlite] Index on expression optimization

2019-02-15 Thread Wout Mertens
Hi, I wonder if the following optimization would be easy to do: sqlite> create table t(a,b); sqlite> create index a on t(a); sqlite> explain query plan select a from t where a is not null; QUERY PLAN `--SCAN TABLE t USING COVERING INDEX a sqlite> explain query plan select a from t where (a is