Hi Daniel, thanks for reply. So it's better to upgrade sqlite that support fts5? I've tried to find how to use latest sqlite in python but there is no help. I should build python from source that I don't want it. Btw, when I need to rank for relevancy, is I must use x parameter? Thank you.
On Thursday, March 17, 2016 4:04 PM, Dan Kennedy <danielk1977 at gmail.com> wrote: On 03/17/2016 12:27 PM, Christoforus Surjoputro wrote: > Hi all. I've example database that can be downloaded here > http://www.megafileupload.com/rhqU/product.db or you can generate yourself by > using this python script:http://pastebin.com/4djPZJ21 > > I try to compare performance between standard query and using matchinfo() > function.Standard queryt:http://pastebin.com/RFZwx8AJ > > matchinfo():http://pastebin.com/BBq28HNh > > Script that use matchinfo() function about 20x slower than standard query. Is > that normal or something wrong with my query or my database? And how to > improve the matchinfo() performance? Because your query has a LIMIT 1 clause, FTS3 usually has to find just the first result that matches the full-text query. However, a matchinfo call with the 'x' flag specified has to loop through all the rows that match the query, as one of the values returned by 'x' is the total number of matches in all rows. In FTS3 there is no way to get this information without iterating through all matching rows. FTS5 is more faster and more flexible, IMO. Dan. _______________________________________________ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users