On 10/14/2011 11:23 PM, Simon Slavin wrote:
On 14 Oct 2011, at 5:12pm, Fabian wrote:
Is this the expected output? If so, ANALYZE was to blame. The
query containing 'ORDER BY rowid DESC' is still slower than the one
which doesn't specify any order, but the results are closer to
eachother now.
Iterating backwards is often a bit slower than iterating forwards.
Especially with a database that not very fragmented.
So that should never happen, right ? ANALYZE is meant to make things
faster, not slower. So is that an actual fixable bug or is it one of
those extremely unlikely situations that is hard to fix ?
I'd agree it's a subtle bug. Since "SELECT WHERE data=10 ORDER BY rowid"
is in practice the same query as "WHERE data=10", it's difficult to
think of a reason why ANALYZE data should cause SQLite to change the
query plan for one of them and not the other.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users