Subject Re: [firebird-support] Re: Limiting fetched rows doesn't offer much performance benefit
Author Daniel Rail
Hi,

At March 7, 2006, 5:21 PM, jimbehr3446 wrote:

> <Ivan.Prenosil@...> wrote:
>>
>> Firebird will first use the index to create list of potentially
> matching records,
>> then it retrieves first 50 and stops, it will not read all rows
> internally.
>>
> It will not read all of the rows unless all of them match the query
> (which can happen sometimes with our situation). So then FB would
> read through millions when all we want is the first 50 it finds.

> When there is no ORDER BY clause it would be faster for FB to just
> return the first 50 that match. But it does not appear to work that
> way. And I have not been able to find a workaround.

What about a selectable stored procedure?

--
Best regards,
Daniel Rail
Senior Software Developer
ACCRA Consultants Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)