sqlite> CREATE TABLE "history"("v" INTEGER PRIMARY KEY AUTOINCREMENT, "type" TEXT, "data" JSON); sqlite> CREATE INDEX "type_size" on history(type, length(data)); sqlite> explain query plan select type from history group by type; QUERY PLAN `--SCAN TABLE history USING COVERING INDEX type_size sqlite> explain query plan select type, length(data) from history group by type; QUERY PLAN `--SCAN TABLE history USING INDEX type_size
I would expect the latter query to use COVERING index. Is there a way to hint this? (I checked the actual opcodes and indeed it reads the table column and runs length again) Wout. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users