Subject | Re: [firebird-support] select fieldA >= xxx is very very slow on Big table ? |
---|---|
Author | Paul Vinkenoog |
Post date | 2010-12-19T22:20:37Z |
All,
first one where fielda >= xxx. It doesn't even have to get the *smallest*
matching fielda (although it probably will), because there's no ORDER BY.
Paul Vinkenoog
>> why this simple sentence :Hmmm, I'd say it doesn't have to get all the matching records. Just the
>>
>> 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.
first one where fielda >= xxx. It doesn't even have to get the *smallest*
matching fielda (although it probably will), because there's no ORDER BY.
Paul Vinkenoog