Thread: Re: descending index

Re: descending index

From
"Pirtea Calin"
Date:
"Björn Lundin" wrote:
> Can't you use 'order by' with 'asc or desc' ?
> /Björn

Of course. I just wanted to know if there is a diference between using
order by field asc/desc regarding the way indexes are used in plans
when you execute a query. In Firebird when using order by desc it uses
the descending index if available if not then it uses natural scan with
sort descending. Does PostgreSQL use the ascending index both for
asc and desc order by?

Thanks in advance.

--
Best regards,
Aplication Developer
Pirtea Calin Iancu
S.C. SoftScape S.R.L.
pcalin@rdsor.ro


Re: descending index

From
CoL
Date:
Pirtea Calin wrote:
> "Björn Lundin" wrote:
>
>>Can't you use 'order by' with 'asc or desc' ?
>>/Björn
>>
>
> Of course. I just wanted to know if there is a diference between using
> order by field asc/desc regarding the way indexes are used in plans
> when you execute a query. In Firebird when using order by desc it uses
> the descending index if available if not then it uses natural scan with
> sort descending. Does PostgreSQL use the ascending index both for
> asc and desc order by?
>
> Thanks in advance.
>
Both.

C.