Martin Engelschalk <[EMAIL PROTECTED]> wrote:
> Hello All,
> 
> I have to select data from a large table (several million records) in 
> descending order and created an index for that purpose. However, sqlite 
> seems not to use this index for selecting the data.
> 
> In the documentation of the "create index" - statement, i found the 
> following sentence:
> 
> "Each column name can be followed by one of the "ASC" or "DESC" keywords 
> to indicate sort order, but the sort order is ignored in the current 
> implementation. Sorting is always done in ascending order."
> 
> However, the news for Version 3.3.0 of Jan 2006 says:
> 
> "Version 3.3.0 adds support for  .... DESC indices".
> 
> Is this a contradiction? Can sqlite use an index for order by ... desc - 
> clauses? Or am i doing sonething wrong?
> 

You have to enable decending indices using a pragma:

   PRAGMA legacy_file_format=OFF;

But a SELECT will use an index to sort the results in
decending order regardless of whether or not the index
is in decending order.  So that isn't your problem.
You are doing something else wrong.

Post your query, your table schema, and your index
definitions and we will have a look.

--
D. Richard Hipp <[EMAIL PROTECTED]>

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to