On Wed, Nov 9, 2016 at 12:20 PM Clemens Ladisch <clem...@ladisch.de> wrote:
> Wout Mertens wrote: > > Another approach I thought of is to assume I will only have a certain > > number of array items (let's say 5), generate an "where is not null" > > expression index for each of them, and then query them with 5 OR clauses. > > Would that use more or less resources? > > Check with EXPLAIN QUERY PLAN whether the indexes are used at all. > It's possible you'll have to use UNION instead. No: sqlite> create table t(json JSON); sqlite> create index foo on t(json); sqlite> explain query plan select * from t where json = '5'; 0|0|0|SEARCH TABLE t USING COVERING INDEX foo (json=?) sqlite> explain query plan select * from t where json like '5'; 0|0|0|SCAN TABLE t Thanks for the FTS5 link! Wout _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users