pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathanael Terrien <nte@mustinformatique.fr>
To: Heikki Linnakangas <hlinnakangas@vmware.com>
To: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: Exponential processing time for multiple SELECT FOR UPDATE / UPDATE in a single transaction with PostgreSQL 9.x ?
Date: Fri, 5 Dec 2014 11:03:05 +0000
Message-ID: <70c49d62fc764ef5a723a92c0e6e07a0@EXCH2013.mustinformatique.fr> (raw)
In-Reply-To: <54818D6C.5070702@vmware.com>
References: <52dd07051f6b42b09328c339c7b9c5d4@EXCH2013.mustinformatique.fr>
	<54818D6C.5070702@vmware.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>

> Maybe. Or just changed behavior between 8.4 and 9.0.

The tests we performed with other connection methods don't slow down  (Omnis 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. 
Do you mind if it's a DotNet EXE  ?

-----Message d'origine-----
De : Heikki Linnakangas [mailto:hlinnakangas@vmware.com] 
Envoyé : vendredi 5 décembre 2014 11:48
À : Nathanael Terrien; pgsql-odbc@postgresql.org
Objet : Re: [ODBC] Exponential processing time for multiple SELECT FOR UPDATE / 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 (« 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



view thread (8+ messages)  latest in thread

Message-ID: <70c49d62fc764ef5a723a92c0e6e07a0@EXCH2013.mustinformatique.fr>
Permalink:  ../70c49d62fc764ef5a723a92c0e6e07a0@EXCH2013.mustinformatique.fr/
Also on:    postgresql.org/message-id/70c49d62fc764ef5a723a92c0e6e07a0@EXCH2013.mustinformatique.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: nte@mustinformatique.fr, hlinnakangas@vmware.com
  Subject: Re: Exponential processing time for multiple SELECT FOR UPDATE / UPDATE in a single transaction with PostgreSQL 9.x ?
  In-Reply-To: <70c49d62fc764ef5a723a92c0e6e07a0@EXCH2013.mustinformatique.fr>
  References: <52dd07051f6b42b09328c339c7b9c5d4@EXCH2013.mustinformatique.fr> <54818D6C.5070702@vmware.com> <70c49d62fc764ef5a723a92c0e6e07a0@EXCH2013.mustinformatique.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox