Skip site navigation (1) Skip section navigation (2)

Re: More thoughts about FE/BE protocol

From: Barry Lind <blind(at)xythos(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: More thoughts about FE/BE protocol
Date: 2003-04-10 21:19:22
Message-ID: 3E95DFDA.3010101@xythos.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-interfaces
Tom,

This all sounds great.  I am really looking to seeing all of this 
implemented.  Are you still on schedule for getting this into 7.4?  And 
will there be time left for the clients to make the changes necessary to 
use the new protocol?

thanks,
--Barry


Tom Lane wrote:
> Barry Lind <blind(at)xythos(dot)com> writes:
> 
>>When an application needs to do a lot of the same thing (i.e 
>>insert a thousand rows), the applicaiton tells the driver to insert a 
>>'batch' of 1000 rows instead of performing 1000 regular inserts. This 
>>allows the driver to optimize this operation as one network roundtrip 
>>instead of 1000 roundtrips.
>>... How could this be accomplished with the 
>>new FE/BE protocol "extended query" facility?
> 
> 
> Well, as far as network roundtrips go, it's always been true that you
> don't really have to wait for the backend's response before sending the
> next command.  The proposal to decouple SYNC from individual commands
> should make this easier: you fire off N commands "blind", then a SYNC.
> When the sync response comes back, it's done.  If any of the commands
> fail, all else up to the SYNC will be ignored, so you don't have the
> problem of commands executing against an unexpected state.
> 
> (I'm not sure it'd be bright to issue thousands of commands with no
> SYNC, but certainly reasonable-size batches would be sensible.)
> 
> As for lots of instances of the same kind of command, you could PARSE
> the SQL insert command itself just once (with parameter placeholders for
> the data values), then repeat BIND/EXECUTE pairs as often as you want.
> That's probably about as efficient as you're going to get without
> switching to COPY mode.
> 
> Does that address your concern, or is there more to do?
> 
> 			regards, tom lane
> 


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2003-04-10 22:04:48
Subject: Re: More thoughts about FE/BE protocol
Previous:From: Jan WieckDate: 2003-04-10 20:28:46
Subject: Re: More thoughts about FE/BE protocol

pgsql-interfaces by date

Next:From: Tom LaneDate: 2003-04-10 22:04:48
Subject: Re: More thoughts about FE/BE protocol
Previous:From: Michiel LangeDate: 2003-04-10 20:59:22
Subject: Re: Getting to learn libpqxx

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group