Re: Incremental results from libpq - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: Incremental results from libpq
Date
Msg-id 5329.1132151064@sss.pgh.pa.us
Whole thread Raw
In response to Re: Incremental results from libpq  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-interfaces
Peter Eisentraut <peter_e@gmx.net> writes:
> Am Mittwoch, 9. November 2005 22:22 schrieb Tom Lane:
>> The main reason why libpq does what it does is that this way we do not
>> have to expose in the API the notion of a command that fails part way
>> through.

> I'm at LinuxWorld Frankfurt and one of the Trolltech guys came over to talk to 
> me about this.  He opined that it would be beneficial for their purpose (in 
> certain cases) if the server would first compute the entire result set and 
> keep it in the server memory (thus eliminating potential errors of the 1/x 
> kind) and then ship it to the client in a way that the client would be able 
> to fetch it piecewise.  Then, the client application could build the display 
> incrementally while the rest of the result set travels over the (slow) link.  
> Does that make sense?

Ick.  That seems pretty horrid compared to the straight
incremental-compute-and-fetch approach.  Yes, it preserves the illusion
that a SELECT is all-or-nothing, but at a very high cost, both in terms
of absolute runtime and in terms of needing a new concept in the
frontend protocol.  It also doesn't solve the problem for people who
need incremental fetch because they have a result set so large they
don't want it materialized on either end of the wire.  Furthermore, ISTM
that any client app that's engaging in incremental fetches really has to
deal with the failure-after-part-of-the-query-is-done problem anyway,
because there's always a risk of failures on the client side or in the
network connection.  So I don't see any real gain in conceptual
simplicity from adding this feature anyway.

Note that if Trolltech really want this behavior, they can have it today
--- it's called CREATE TEMP TABLE AS SELECT.  It doesn't seem attractive
enough to me to justify any further feature than that.
        regards, tom lane


pgsql-interfaces by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: Incremental results from libpq
Next
From: "Goulet, Dick"
Date:
Subject: Re: Incremental results from libpq