Subject | RE: [firebird-support] Ordering with nulls first and index usage |
---|---|
Author | Leyne, Sean |
Post date | 2012-11-30T21:26:54Z |
> When I specify ORDER BY A_COLUMN DESC NULLS FIRST, the descending indexNo.
> created on this column is not used and I get 'natural' in plan.
> Is there a possibility to use some index when 'nulls first' is specified .
In order for an index to be used for ORDER BY, the sort order much match exactly the storage order of the index.
All indexes have NULLs stored at the end (ie. not first).
Sean