> > --- In firebird-support@yahoogroups.com, "Ivan Prenosil"
> > <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.
>
> as I say - the workaround is to use an order by clause. it's simple
> Alan
and I mean order by PK (not the flag field)
>
> >
> > Thanks for your comments.
>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>
>