Not sure if this is intentional, but it looks like the wrong index is being
selected on fts tables when a rowid is involved.

Given a table:

CREATE VIRTUAL TABLE MessagesFts USING fts3(Message);

Explain query plan using sqlite 3.6.21:

sqlite> EXPLAIN QUERY PLAN SELECT * FROM MessagesFts WHERE docid=1 AND
Message MATCH 'ABC*';
0|0|TABLE MessagesFts VIRTUAL TABLE INDEX 1:

However doing the same in 3.6.22:

sqlite> EXPLAIN QUERY PLAN SELECT * FROM MessagesFts WHERE docid=1 AND
Message MATCH 'ABC*';
0|0|TABLE MessagesFts VIRTUAL TABLE INDEX 2:

Note that different indexes are now picked.

This seems to mesh with behaviour I've found...

Using 3.6.22, when MessagesFts contains a lot of entries that would match
ABC*, the query takes exceedingly long time to run, since it seems to be
doing the fts before narrowing down by docid. I imagine that it's supposed
to narrow down by docid first.

- Nasron
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to