Re: Proper query implementation for Postgresql driver - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: Proper query implementation for Postgresql driver
Date
Msg-id 5427E5A9.5060109@joh.to
Whole thread Raw
In response to Proper query implementation for Postgresql driver  (Shay Rojansky <roji@roji.org>)
Responses Re: Proper query implementation for Postgresql driver
List pgsql-hackers
On 9/28/14, 11:53 AM, Shay Rojansky wrote:
> I would, in theory, love to switch the entire thing to binary and thereby
> avoid all textual parsing once and for all. If I understand correctly, this
> means all queries must be implemented as extended queries, with numerous
> extra client-server roundtrips - which are a bit hard to stomach. Section
> 49.1.2 of the manual also states that the unnamed prepared statement and
> portal are optimized for the case of executing a query only once, hinting
> that this is the proper way to do things - but this optimization still
> cannot not eliminate the extra roundtrips mentioned above (PREPARE, BIND,
> EXECUTE).

You don't have to do multiple round-trips for that; you can just send 
all the messages in one go.  See how e.g. libpq does it in PQexecParams().


.marko



pgsql-hackers by date:

Previous
From: Shay Rojansky
Date:
Subject: Proper query implementation for Postgresql driver
Next
From: Andreas Karlsson
Date:
Subject: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}