Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XwSPY-00037K-1d for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Dec 2014 09:09:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XwSPW-0000Ll-C6 for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Dec 2014 09:09:18 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XwSPV-0000Lf-D2 for pgsql-hackers@postgresql.org; Thu, 04 Dec 2014 09:09:17 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XwSPQ-0003vH-Gt for pgsql-hackers@postgresql.org; Thu, 04 Dec 2014 09:09:14 +0000 Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 0BDB328B90; Thu, 4 Dec 2014 01:09:10 -0800 (PST) Received: from EX13-CAS-002.vmware.com (EX13-CAS-002.vmware.com [10.113.191.52]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 0643A41433; Thu, 4 Dec 2014 01:09:10 -0800 (PST) Received: from EX13-MBX-024.vmware.com (10.113.191.44) by EX13-MBX-009.vmware.com (10.113.191.29) with Microsoft SMTP Server (TLS) id 15.0.913.22; Thu, 4 Dec 2014 01:10:00 -0800 Received: from [192.168.1.90] (10.113.160.246) by EX13-MBX-024.vmware.com (10.113.191.44) with Microsoft SMTP Server (TLS) id 15.0.913.22; Thu, 4 Dec 2014 01:09:00 -0800 Message-ID: <54802498.7020704@vmware.com> Date: Thu, 4 Dec 2014 11:08:40 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-Version: 1.0 To: Matt Newell , Subject: Re: libpq pipelining References: <2059418.jZQvL3lH90@obsidian> In-Reply-To: <2059418.jZQvL3lH90@obsidian> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.113.160.246] X-ClientProxiedBy: EX13-CAS-013.vmware.com (10.113.191.65) To EX13-MBX-024.vmware.com (10.113.191.44) X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 12/04/2014 03:11 AM, Matt Newell wrote: > The recent discussion about pipelining in the jodbc driver prompted me to look > at what it would take for libpq. Great! > I have a proof of concept patch working. The results are even more promising > than I expected. > > While it's true that many applications and frameworks won't easily benefit, it > amazes me that this hasn't been explored before. > > I developed a simple test application that creates a table with a single auto > increment primary key column, then runs a 4 simple queries x times each: > ... > > I plan to write documentation, add regression testing, and do general cleanup > before asking for feedback on the patch itself. Any suggestions about > performance testing or api design would be nice. I haven't played with > changing the sync logic yet, but I'm guessing that an api to allow manual sync > instead of a sync per PQsendQuery will be needed. That could make things > tricky though with multi-statement queries, because currently the only way to > detect when results change from one query to the next are a ReadyForQuery > message. A good API is crucial for this. It should make it easy to write an application that does pipelining, and to handle all the error conditions in a predictable way. I'd suggest that you write the documentation first, before writing any code, so that we can discuss the API. It doesn't have to be in SGML format yet, a plain-text description of the API will do. - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers