Subject Re: [firebird-support] Re: Limiting fetched rows doesn't offer much performance benefit
Author Richard Wesley
On Mar 7, 2006, at 13:32, jimbehr3446 wrote:

> I'm not sure that query would work since you haven't specified a
> fieldname in the where clause.

It computes the rand() value independently for every row and then
returns only those rows where this value is less than .01 (i.e. about
1% of the table).

> But, ignoring that, I believe FB will
> look at every record (using an index of course if available) to
> determine the complete list and then it will return the number you
> specify in the FIRST n clause.

There is no FIRST clause - I was giving a possibly related example of
your failure. In the case I am interested in, "table" might be a
join . The idea is that if FB makes a copy of the table before
applying the where, then this is a very inefficient query. If it just
drops rows as they come of the disk, (as I would do if I were willing
to ship the entire table over the wire) then it is much more
efficient in terms of bandwidth.

Richard Wesley
hawkfish tableausoftware com