Subject Re: How to improve descending query performance
Author Sean
--- In firebird-support@yahoogroups.com, "Adam" <s3057043@...> wrote:

> I would attempt to trick it to read in storage order. Try this one:
>
> select first 1000 * from A
> where update_time >= '13-JUN-2006 00:00:00'
> and update_time <= '13-JUN-2007 00:00:00'
> and id <= 3000000
> and id >= 2000
> order by id+0 desc
>

I tried it and it tooks 16 minutes. The plan chosen by firebird was:

PLAN SORT((A INDEX(PK_A)))