-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/12/2011 02:13 PM, Richard Hipp wrote:
>> But SQLITE_ENABLE_STAT2 breaks that guarantee.  With STAT2, the ANALYZE
>> command stores a histogram of left-most column of each index in order to
>> help it make decisions about whether or not to use that index.  Consider a
>> query like this:

Your goals make a lot of sense.  However I think you can do my second
suggestion.  Compile with STAT2 code included by default, but make the
analyze command only build stat1 by default.

This will result in no change in default behaviour, but means that anyone
wanting to use stat2 can easily do so.  (The vast majority of SQLite
non-embedded device deployments do not compile SQLite themselves and are
arguably in the "business applications" demographic.)

If I build a database right now and mail it off to another random SQLite
user and even if I compile with stat2 and run analyze, then it is unlikely
they will be able to make use of the stat2 information.

You can make ANALYZE take a numerical argument or a word such as FULL or
QUICK to explicitly choose which flavour is used.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1XDlwACgkQmOOfHg372QT41wCghceOrhVnAjkbF/apNaVsqMGL
4O8AnjQaHOrXug6UQzR+s0WFtxUyMYif
=1V4N
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to