Subject RE: [firebird-support] Slow descending order select on joint tables
Author Leyne, Sean
Sean, (What a great name!)

> I need to furtherly join table_A to a small table with only 5 records.
> Now the query is revised as:
> select first 250 * from table_A A
> left join table_B B
> on A.column = B.column
> where A.time > sometimestamp
> order by A.ID desc
> Now it takes more than 1 minute :-(
> Can anyone please point out what is missing here?

The FIRST predicate is evaluated based on the *results*.

So, you're query is performing a full join for both tables, then
returning the first 250 rows.