On Dec 18, 2009, at 10:53 PM, Eric Grange wrote:

> Hello All,
>
> Using 3.6.21 and FTS3, I've noticed than when doing search queries,
> using docid as in
>
>  select fts.docid from fts where fts.content match "la"
>
> the search is much slower than when using rowid as in
>
>  select fts.rowid from fts where fts.content match "la"
>
> Isn't docid supposed to be an alias of rowid in the case of FTS3  
> tables?
> Is there anything wrong that can happen when using rowid instead of  
> docid?
> Or is it merely a missing optimization?
>
> The speed difference depends on the number of returned results, but it
> can be several orders of magnitude when the index isn't in cache, and
> the memory usage is much higher too. I guess in one case the value is
> obtained directly from the index, while in the other one it's read  
> from
> the fts_content table, is this correct?

Exactly correct. This was fixed after 3.6.21 was released:

http://www.sqlite.org/src/ci/48c0db0eb2

Dan.



>
> Thanks!
> Eric
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to