Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XwqfP-0004vB-2J for pgsql-odbc@arkaria.postgresql.org; Fri, 05 Dec 2014 11:03:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XwqfO-0007X5-8c for pgsql-odbc@arkaria.postgresql.org; Fri, 05 Dec 2014 11:03:18 +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 1XwqfM-0007Ww-EN for pgsql-odbc@postgresql.org; Fri, 05 Dec 2014 11:03:16 +0000 Received: from smtp05.smtpout.orange.fr ([80.12.242.127] helo=smtp.smtpout.orange.fr) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XwqfE-0001tS-Q9 for pgsql-odbc@postgresql.org; Fri, 05 Dec 2014 11:03:15 +0000 Received: from EXCH2013.mustinformatique.fr ([80.14.156.7]) by mwinf5d62 with ME id Pn361p00V09r3GY03n37av; Fri, 05 Dec 2014 12:03:08 +0100 X-ME-Helo: EXCH2013.mustinformatique.fr X-ME-Auth: bXVzdC1pbmZvcm1hdGlxdWVAd2FuYWRvby5mcg== X-ME-Date: Fri, 05 Dec 2014 12:03:08 +0100 X-ME-IP: 80.14.156.7 Received: from EXCH2013.mustinformatique.fr (172.17.0.152) by EXCH2013.mustinformatique.fr (172.17.0.152) with Microsoft SMTP Server (TLS) id 15.0.913.22; Fri, 5 Dec 2014 12:03:06 +0100 Received: from EXCH2013.mustinformatique.fr ([fe80::cde4:330a:630e:e700]) by EXCH2013.mustinformatique.fr ([fe80::cde4:330a:630e:e700%12]) with mapi id 15.00.0913.011; Fri, 5 Dec 2014 12:03:06 +0100 From: Nathanael Terrien To: Heikki Linnakangas , "pgsql-odbc@postgresql.org" Subject: Re: Exponential processing time for multiple SELECT FOR UPDATE / UPDATE in a single transaction with PostgreSQL 9.x ? Thread-Topic: [ODBC] Exponential processing time for multiple SELECT FOR UPDATE / UPDATE in a single transaction with PostgreSQL 9.x ? Thread-Index: AdAQadpRsl3uPnmvSe2SgOKYbc4NtQABrrsAAAIzbMA= Date: Fri, 5 Dec 2014 11:03:05 +0000 Message-ID: <70c49d62fc764ef5a723a92c0e6e07a0@EXCH2013.mustinformatique.fr> References: <52dd07051f6b42b09328c339c7b9c5d4@EXCH2013.mustinformatique.fr> <54818D6C.5070702@vmware.com> In-Reply-To: <54818D6C.5070702@vmware.com> Accept-Language: fr-FR, en-US Content-Language: fr-FR X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.17.1.31] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Pg-Spam-Score: -1.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 > Maybe. Or just changed behavior between 8.4 and 9.0. The tests we performed with other connection methods don't slow down (Omni= s Studio + PGDAM, C# + npgsql, or just a function called multiple times in = the same query window from pgAdmin). > Could you write a self-contained test case to demonstrate this? Yes.=20 Do you mind if it's a DotNet EXE ? -----Message d'origine----- De=A0: Heikki Linnakangas [mailto:hlinnakangas@vmware.com]=20 Envoy=E9=A0: vendredi 5 d=E9cembre 2014 11:48 =C0=A0: Nathanael Terrien; pgsql-odbc@postgresql.org Objet=A0: Re: [ODBC] Exponential processing time for multiple SELECT FOR UP= DATE / UPDATE in a single transaction with PostgreSQL 9.x ? On 12/05/2014 11:14 AM, Nathanael Terrien wrote: > Hi List. > > Our application does something like this, through psqlodbc : > ---------------------------------------------------------------------- > -------- > Open transaction (=AB BEGIN =BB) > FOR x TO y STEP 1 > Do Stuff > =AB SELECT col1 FROM table1 WHERE condition1 FOR UPDATE ; =BB > Do Stuff > =AB UPDATE table1 SET col1=3Dz WHERE condition1 ; =BB > Do Stuff > NEXT x > End transaction (=AB COMMIT =BB) > ---------------------------------------------------------------------- > -------- > > Against PostgreSQL 8.4 : no problem. > Against PostgreSQL 9.x : starting at about a few hundred loops (locks), t= he 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 Post= greSQL (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?=20 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 --=20 Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc