On 8 Feb 2011, at 4:22pm, Sven L wrote:

> Thank you very much for your detailed explanation!

You're welcome.  I've actually never had to think out this feature of SQLite 
before, so it was interesting for me too.  I hope Richard or the rest of the 
team will correct me if I got anything wrong.

> I will comment out my calls to ANALYZE, and see how my software performs.
> 
> The reason why I added it in the first place is that users are allowed to 
> create their own queries, and since not all of them are SQL experts, I wanted 
> the engine to be as tolerant as possible. Perhaps it's a better idea to 
> simply crave decent SQL!

Allowing users to make up their own queries on the fly does make things a 
little more difficult as you worked out: you can't pre-make good indexes.  The 
big server/client databases cache temporary indexes (and share them between 
users), so they handle unexpected queries far better: if any query comes in 
that doesn't suit any indexes it simply makes up a new temporary index and 
keeps it in case it's needed later.  SQLite can't do this because it's designed 
for a tiny footprint and can't chew up lots of memory or disk space without a 
good reason.

But your initial questions did sound a little like premature optimisation and I 
think you'll get decent results without worrying too much about it.  I'm sure 
the overwhelming number of SQLite users have never used ANALYZE even once.

Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to