Subject RE: [IBDI] Firebird 1
Author Ann W. Harrison
> > -----Original Message-----
> > From: Ann W. Harrison [mailto:aharrison@...]
> >
> > There's already code in the engine to limit the number of rows returned,
> > but no code to handle a request that says "give me rows 21 to 30." It
> > could be done, hideously inefficiently, on the server side, I suppose, but
> > it would require lots of changes.

At 12:22 PM 5/31/2001 +0200, Paulo Gaspar wrote:


>I think that "hideously inefficiently" but "on the server side" is still
>nice, since it avoids sending a lot of data from the database server to the
>client application.

The server doesn't send anything to the client unless the client
requests it. (Not quite true - the server sends a packetful of
data - not just one row at a time, but the cost of a packet is the
same as the cost of an individual row.) Some middleware may always
read all the data, but there is no reason why a dynamic SQL program
should.

The problem I have with the syntax SELECT .... LIMIT (11, 20)
is that I assume what's really going to happen is:

SELECT .... LIMIT (1, 10)
SELECT .... LIMIT (11, 20)
SELECT .... LIMIT (21, 30)
....
SELECT .... LIMIT (111, 120)

If this were done as a single select, it would read 120 records.
If it were done as individual limited selects, it would read
over 6000 records. I suppose that doesn't matter.



Regards,

Ann
www.ibphoenix.com
We have answers.