On Fri, Nov 30, 2018 at 3:15 PM Dominique Devienne <ddevie...@gmail.com>
wrote:

> sqlite> .header on
> sqlite> create table t (c, n);
> sqlite> insert into t values (1, 'one'), (2, 'two'), (3, 'three');
> sqlite> select n from t where c in (select value from json_each('[1, 3]'));
> n
> one
> three


Very nice! Now I can finally prepare IN statements. I took a look at the
EXPLAIN and it creates a temp table with the json values to check the IN
against, one time before looping through the table. In most cases the I/O
overhead of the table search will dwarf the JSON + table overhead, so it
should perform very well.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to