X-Original-To: pgsql-hackers@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6735847592C; Thu, 10 Apr 2003 17:19:22 -0400 (EDT) Received: from mail.xythos.com (unknown [206.14.210.116]) by postgresql.org (Postfix) with ESMTP id 8023D475458; Thu, 10 Apr 2003 17:19:21 -0400 (EDT) Received: from ravms by mail.xythos.com with mail-ok (Exim 3.36 #3) id 193jS7-0000oR-00; Thu, 10 Apr 2003 21:19:23 +0000 Received: from localhost.localdomain ([127.0.0.1] helo=xythos.com) by mail.xythos.com with asmtp (Exim 3.36 #3) id 193jS7-0000oG-00; Thu, 10 Apr 2003 21:19:23 +0000 Message-ID: <3E95DFDA.3010101@xythos.com> Date: Thu, 10 Apr 2003 14:19:22 -0700 From: Barry Lind User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: pgsql-hackers@postgresql.org, pgsql-interfaces@postgresql.org Subject: Re: More thoughts about FE/BE protocol References: <10478.1049927451@sss.pgh.pa.us> <3E95A3CD.9080500@xythos.com> <5564.1049998513@sss.pgh.pa.us> In-Reply-To: <5564.1049998513@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Envelope-To: tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org, pgsql-interfaces@postgresql.org X-Spam-Status: No, hits=-38.8 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_MOZILLA_UA autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/340 X-Sequence-Number: 37830 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 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 >