Обсуждение: Client libraries supporting pipelining
Which client libraries support pipelining, to reduce server round-trips? It seems that the protocol and libpq supports it, but are there any bindings for high-level languages yet? I would like to avoid using C directly if at all possible.
On Mon, 13 Feb 2006, Florian Weimer wrote: > Which client libraries support pipelining, to reduce server > round-trips? JDBC supports batch execution for INSERT, UPDATE, and DELETE via [Prepared]Statement.addBatch(). Support for multiple ResultSets is available by concatenating queries with ; and sending them in the standard fashion. Kris Jurka
On Mon, Feb 13, 2006 at 09:59:06PM +0100, Florian Weimer wrote: > It seems that the protocol and libpq supports it, but are there any > bindings for high-level languages yet? I would like to avoid using C > directly if at all possible. There are many many libpq bindings for many many languages. There's also a few PQ protocol implementations aside from libpq, most of which are not in C. Google for em': postgresql <language> driver -- Regards, James William Pye
* James William Pye: > There are many many libpq bindings for many many languages. There's > also a few PQ protocol implementations aside from libpq, most of > which are not in C. Yes, but not many of them provide access to the batching interfaces (PQsendQueryPrepared and friends).
On Tue, February 14, 2006 03:59, Florian Weimer wrote: > Which client libraries support pipelining, to reduce server > round-trips? The C++ interface libpqxx does support pipelining of queries--but perhaps not quite at the level you had in mind. Its "pipeline" class transparently batches up queries and lets you go off to do useful stuff on the client side while they are being submitted and processed. Thus it provides both "split-transaction" operation to hide latency and batch submission to reduce the number of roundtrips. You get to influence when the current batch is sent off, through a minimal interface. Normal operation consists of inserting queries in the one end and retrieving results out the other. This is not an extremely sophisticated mechanism, however. It doesn't do any client-side background processing, and it doesn't transparently prepare statements before executing them. You could still prepare them yourself, of course--or if it really helps to do so automatically, that could be implemented under the existing API. You can find libpqxx at http://thaiopensource.org/development/libpqxx/ Jeroen