Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XwqRa-0004Mw-BV for pgsql-odbc@arkaria.postgresql.org; Fri, 05 Dec 2014 10:49:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XwqRZ-0006S4-RM for pgsql-odbc@arkaria.postgresql.org; Fri, 05 Dec 2014 10:49:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XwqRZ-0006Ry-C8 for pgsql-odbc@postgresql.org; Fri, 05 Dec 2014 10:49:01 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XwqRQ-0001dE-RH for pgsql-odbc@postgresql.org; Fri, 05 Dec 2014 10:48:56 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id B27D22928C; Fri, 5 Dec 2014 02:48:48 -0800 (PST) Received: from EX13-CAS-005.vmware.com (EX13-CAS-005.vmware.com [10.113.191.55]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id AC7BD190CF; Fri, 5 Dec 2014 02:48:48 -0800 (PST) Received: from EX13-MBX-024.vmware.com (10.113.191.44) by EX13-MBX-002.vmware.com (10.113.191.22) with Microsoft SMTP Server (TLS) id 15.0.913.22; Fri, 5 Dec 2014 02:48:48 -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; Fri, 5 Dec 2014 02:48:39 -0800 Message-ID: <54818D6C.5070702@vmware.com> Date: Fri, 5 Dec 2014 12:48:12 +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: Nathanael Terrien , "pgsql-odbc@postgresql.org" Subject: Re: Exponential processing time for multiple SELECT FOR UPDATE / UPDATE in a single transaction with PostgreSQL 9.x ? References: <52dd07051f6b42b09328c339c7b9c5d4@EXCH2013.mustinformatique.fr> In-Reply-To: <52dd07051f6b42b09328c339c7b9c5d4@EXCH2013.mustinformatique.fr> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 8bit 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-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 12/05/2014 11:14 AM, Nathanael Terrien wrote: > Hi List. > > Our application does something like this, through psqlodbc : > ------------------------------------------------------------------------------ > Open transaction (« BEGIN ») > FOR x TO y STEP 1 > Do Stuff > « SELECT col1 FROM table1 WHERE condition1 FOR UPDATE ; » > Do Stuff > « UPDATE table1 SET col1=z WHERE condition1 ; » > Do Stuff > NEXT x > End transaction (« COMMIT ») > ------------------------------------------------------------------------------ > > Against PostgreSQL 8.4 : no problem. > Against PostgreSQL 9.x : starting at about a few hundred loops (locks), the process slows down, and continues to slow down exponentially, until the COMMIT happens. > > We tried with different languages (C#, Omnis Studio, plain plpgsql ...), different versions of psqlodbc (8.4.2 to 9.3.x), different versions of PostgreSQL (8.4, 9.3, 9.4 RC1) , without psqlODBC ... and it all comes down to this : > The slow-down only happens with psqlodbc and PostgreSQL 9.x > > So we guess it's abug ? Maybe. Or just changed behavior between 8.4 and 9.0. Could you write a self-contained test case to demonstrate this? Something with the CREATE TABLE and other statements required to create the database, and a small test program. It's pretty hard to debug otherwise. - Heikki -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc