Back with more indexing questions :)

12991 $ sqlite3
SQLite version 3.19.3 2017-06-08 14:26:16
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> create table t(j json, s string);
sqlite> create index s on t(s);
sqlite> create index j on t(json_extract(j, '$.foo'));
sqlite> create index l on t(length(s));
sqlite> explain query plan select distinct s from t;
0|0|0|SCAN TABLE t USING COVERING INDEX s
sqlite> explain query plan select distinct json_extract(j, '$.foo') from t;
0|0|0|SCAN TABLE t USING INDEX j
sqlite> explain query plan select distinct length(s) from t;
0|0|0|SCAN TABLE t USING INDEX l

How come the indexes on calculated values are not considered COVERING?
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to