Subject Re: [firebird-support] select fieldA >= xxx is very very slow on Big table ?
Author Markus Ostenried
On Sun, Dec 19, 2010 at 21:08, Vander Clock Stephane
<svanderclock@...> wrote:
> Hello,
>
> why this simple sentence :
>
> Select
>   First 1 skip 0 ID
> from
>   TABLEA
> where
>   FIELDA >= xxx
> PLAN (TABLEA INDEX (FIELDA_IDX))
>
> is very slow on big table (> 20 000 000 rows) ... it's take more than 10
> seconds to return :(
>
> this is an index on FIELDA
>
> did i do something wrong ?

How many records would be returned without the FIRST...SKIP clause?
I think Firebird has to get all those records first and then will
return only the first to you.

Can't you narrow your result down some more?