--- "Mrs. Brisby" <[EMAIL PROTECTED]> wrote: > That all said, it seems like this problem is already solved- SQLite does > the right thing after ANALYZE is called. Perhaps it wouldn't be too > difficult to update the statistics that ANALYZE collects in after > COMMIT, or perhaps after a COMMIT that runs longer than a particular > amount of time. > > This would obsolete the need for a control, and as I've said, controls > are bad.
I do agree that controls generally suck. But we live in an imperfect world, and sometimes we know better than the tools we are using and have to intervene and steer them in a better direction. The auto ANALYZE might work fine on small databases, but not all of us would want to incur the cost of using ANALYZE when it is not required. (I could tell you a related story about Sun Java engineers who thought mutex locking all API accesses to collections classes in Java 1.0 was a brilliant idea. This mis-feature turned out to be brilliantly stupid when people realized that the locking had to be done at a higer level - in the application level - in order for it to be useful. All the automatic locking served to do was slow down the general use of the class, but provided little or no benefit). The Sqlite user now has the choice to go with the Cadillac approach (ANALYZE) - a smooth ride, not always so good on gas, but very comfortable. Or the user may choose to drive with a manual transmission (CROSS JOIN) and obtain better and more predictable control of the vehicle. Choice is a good thing. On a related topic, it seems that Postgres 8.x has added a pragma "join_collapse_limit" to the CROSS JOIN mix to deal with this manual join order thing: http://www.postgresql.org/docs/current/interactive/explicit-joins.html SELECT * FROM a CROSS JOIN b, c, d, e WHERE ...; With join_collapse_limit = 1, this forces the planner to join A to B before joining them to other tables... Even more controls... __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com