pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Barry Lind <blind@xythos.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Cc: pgsql-interfaces@postgresql.org
Subject: Re: More thoughts about FE/BE protocol
Date: Thu, 10 Apr 2003 14:19:22 -0700
Message-ID: <3E95DFDA.3010101@xythos.com> (raw)
In-Reply-To: <5564.1049998513@sss.pgh.pa.us>
References: <10478.1049927451@sss.pgh.pa.us>
	<3E95A3CD.9080500@xythos.com>
	<5564.1049998513@sss.pgh.pa.us>

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@xythos.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
> 




view thread (25+ messages)  latest in thread

Message-ID: <3E95DFDA.3010101@xythos.com>
Permalink:  ../3E95DFDA.3010101@xythos.com/
Also on:    postgresql.org/message-id/3E95DFDA.3010101@xythos.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: blind@xythos.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
  Subject: Re: More thoughts about FE/BE protocol
  In-Reply-To: <3E95DFDA.3010101@xythos.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox