On 5/1/06, Mats Gefvert <[EMAIL PROTECTED]> wrote:
However, we noticed an interesting thing. When we first open the SQLite
database and start running queries on it, the first query always takes
an enormous time to complete: up to 30-45 seconds. It's not a really
complex query, mainly just a lookup from a large table, and subsequent
queries typically run in less than 200 milliseconds. But we've been
totally unable to explain this initial delay. And, furthermore, when we
vary the query, sometimes there's additional delays of similar time
before everything runs smoothly again.

It's loading the database file into the disk cache. After it's loaded into
RAM it's much faster (as you would expect). The suggestion to read it
as a data file works well. It preloads the file into the cache while the
user isn't sitting there waiting on results. I would think a properly crafted
query that's performed after the network shutdown is detected but before
the first user query would do the same thing.

--
SqliteImporter: Command line fixed and delimited text import.
http://www.reddawn.net/~jsprenkl/Sqlite
Version 1.10 released with C++ source

Reply via email to