Hello, I was wondering if anybody has a tip for optimizing the query time on
a table.  I have read several web pages about optimizing SQLite queries, but
have not been able to come to any conclusions.

I have a table:

CREATE VIRTUAL TABLE BookContent using fts3(
 DocumentID INTEGER PRIMARY KEY,
 DocumentType INTEGER,
 ParentDocumentID INTEGER,
 Category TEXT,
 Content TEXT,
 Author TEXT,
 SrcFileIdent INTEGER,
 SrcLineNumber INTEGER);

The key pieces of information are the Category, Content and Author.
Performance is fine with up to 2000 records.  I can do basic queries, and
all works well.

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?

The first thing I did was consider made it a regular SQLite table
(droped the FTS support), and used the same table schema, and added an index
on Author, Content and Category.  However, I did not notice any change in
time, and the database size grew from 11MB to 15MB.

Any suggestions would be greatly qppreciated.

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

Reply via email to