Alberto Simões <[EMAIL PROTECTED]>
wrote:
I have a big table (16 million records) and I want to perform JUST
ONCE an operation to sort by one column:

  SELECT * FROM tbl ORDER BY i DESC;

Now, is it faster to perform just the select, or to do:

  CREATE INDEX tmp ON tbl (i);
  SELECT * FROM tbl ORDER BY i DESC;

My understanding is that SQLite implements ORDER BY by effectively building a temporary index and then iterating over it (unless a suitable existing index is available, of course). So both approaches should take approximately the same time.

Why don't you test both (perhaps on a small subset of a real database) and find out for sure?

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to