Subject | Re: [firebird-support] Re: How to mix ascending and descending fields in one index |
---|---|
Author | Aage Johansen |
Post date | 2009-10-07T19:38:01Z |
kokok_kokok wrote:
index? Did you notice any difference?
There's problably nothing to gain by using an index for sorting -
rather something to lose.
You'll need to read all the records, and the fastest way to do this
is to let Firebird use "natural" (and sort afterwards).
As Martijn wrote: use indexes for filtering records, not for ordering.
--
Aage J.
>what I need is:
> If the index is (a,b) then
>
> "select * from foo order by a, b" uses the index in the plan, but
>Did you try "select * from FOO order by A, B" with and without
> "select * from foo order by a desc, b"
>
>
> How can I create a index to be used in the above sql statement?
>
index? Did you notice any difference?
There's problably nothing to gain by using an index for sorting -
rather something to lose.
You'll need to read all the records, and the fastest way to do this
is to let Firebird use "natural" (and sort afterwards).
As Martijn wrote: use indexes for filtering records, not for ordering.
--
Aage J.