On 8 Jun 2009, at 4:45am, Paul Perry wrote:

> The latest content I have added, has over 31,000 records.  A basic  
> select,
> such as:
>
> Select Content from BookContent where DocumentID = 10;
> takes nearly 15 seconds.  Are there any ways to optimize this?

You need an index, obviously.  You can't have an index on a VIRTUAL  
table.

Could you instead create a TEMPORARY table and read the data into  
it ?  That can have indices on all the fields you care about.  You can  
even copy all the entries from the VIRTUAL table into it in one  
instruction using the form of INSERT that has a SELECT in it.  It's  
faster to load the data into the table first, then create the indices.

The other aspect of this is to wonder why you're using a VIRTUAL table  
in the first place.  Why aren't you searching the source data instead  
of a virtual table ?  The SELECT you described doesn't use the fts3  
feature.

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

Reply via email to