Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UCTWF-0004kk-00 for pgsql-odbc@arkaria.postgresql.org; Mon, 04 Mar 2013 11:25:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UCTWE-00081U-GW for pgsql-odbc@arkaria.postgresql.org; Mon, 04 Mar 2013 11:25:22 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UCTWD-00081P-W1 for pgsql-odbc@postgresql.org; Mon, 04 Mar 2013 11:25:22 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UCTWC-0004cF-AD for pgsql-odbc@postgresql.org; Mon, 04 Mar 2013 11:25:21 +0000 Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 1142028256; Mon, 4 Mar 2013 03:24:49 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 0DAA2B04B8; Mon, 4 Mar 2013 03:24:49 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 366A7121993; Mon, 4 Mar 2013 03:28:16 -0800 (PST) X-Virus-Scanned: amavisd-new at zcs-prod-ext-mta-1.vmware.com Received: from zcs-prod-ext-mta-1.vmware.com ([127.0.0.1]) by localhost (zcs-prod-ext-mta-1.vmware.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lAIyHcEhnk7y; Mon, 4 Mar 2013 03:28:16 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 541C51219CF; Mon, 4 Mar 2013 03:17:28 -0800 (PST) Received: from [192.168.1.90] (unknown [10.113.62.14]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Mon, 4 Mar 2013 03:17:27 -0800 (PST) Message-ID: <513481F6.70706@vmware.com> Date: Mon, 04 Mar 2013 13:13:58 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: Todd Owen CC: pgsql-odbc@postgresql.org Subject: Re: speeding up inserts by pipelining References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.5 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 04.03.2013 12:01, Todd Owen wrote: > Is there any chance of psqlODBC one day supporting query pipelining inside > the scope of calls to SQLExecute? This doesn't seem like too much effort to > implement, although the tricky part is probably the semantics in the case > where some rows succeed and some fail (constaint violations, etc). I'm > tempted to give it a try myself, if I manage to get the build working under > VS2010... Yeah, seems reasonable. I think you'll want to send all the Bind and Execute messages, followed by a single Sync message. That means that all the queries will run as a single transaction, and if any of them fail, all will be rolled back. That seems reasonable, although I don't know what the ODBC spec has to say about that. One tricky aspect is that if you just naively send all the queries first, and then start to read the results, you can get a deadlock caused by full network buffers. If the client doesn't read the responses before it's sent all the queries, the client's receive buffer can fill up with the responses from the backend, so that the backend blocks, trying to send more responses. And at the same time, the client is blocked while trying to send more queries, because the backend's receive buffer is already full of incoming queries. I think you'll need to put the socket into non-blocking mode, and use select()/poll(). - Heikki -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc