On 06/07/2013 12:46 PM, Simon Slavin wrote:
On 7 Jun 2013, at 5:37pm, Brad House <b...@monetra.com> wrote:
I've modified my code to run an Analyze on startup to work around this,
but it obviously takes time to run and slows down startup.
I can't answer your question about why this happens in the first place, but I
can tell you that the results of ANALYZE are saved in the database file through
closing and reopening. If you have run ANALYZE once on data which looks like
the data that will be in your database in normal use, then you don't have to
run it again. SQLite will continue to use that information about table sizes
and 'chunkiness' when devising query plans in the future.
Unfortunately we can't easily predict when analyze might be useful to run
due to transformations in the data that might affect the query planner.
We just temporarily added it as a workaround until we come up with a
better solution which might be something more cron-like.
Thanks.
-Brad
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users