Re: Multiple queries in transit

From: Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Mark Hills <Mark(dot)Hills(at)framestore(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Multiple queries in transit
Date: 2011-11-01 04:58:54
Message-ID: 4EAF7C8E.7070402@xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2011-11-01 00:53, Merlin Moncure wrote:
> On Mon, Oct 31, 2011 at 12:49 PM, Mark Hills<Mark(dot)Hills(at)framestore(dot)com> wrote:

>>> Furthermore, in most apps it'd be a serious PITA to keep track of which
>>> reply is for which query, so I doubt that such a feature is of general
>>> usefulness.
>>
>> In our UI case, we already have a queue. Because libpq can't pipeline
>> multiple queries, we have to make our own queue of them anyway.

In libpqxx (the C++ API) you do get support for this kind of pipelining.
Look for the "pipeline" class. It uses the "concatenate queries,
retrieve multiple results" trick.

The pipeline also serves as an easy-to-manage interface for asynchronous
querying: fire off your query, go do other things while the server is
working, then ask for the result (at which point you'll block if necessary).

Front page: http://pqxx.org/development/libpqxx/

Pipeline class:
http://pqxx.org/devprojects/libpqxx/doc/stable/html/Reference/a00062.html

Jeroen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2011-11-01 05:47:50 Re:
Previous Message Fujii Masao 2011-11-01 04:53:05 Re: Your review of pg_receivexlog/pg_basebackup