Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xwrf8-0007RG-Bc for pgsql-odbc@arkaria.postgresql.org; Fri, 05 Dec 2014 12:07:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xwrf7-0007o8-11 for pgsql-odbc@arkaria.postgresql.org; Fri, 05 Dec 2014 12:07:05 +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 1Xwrf0-0007aN-5H for pgsql-odbc@postgresql.org; Fri, 05 Dec 2014 12:06:58 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Xwreu-0002jF-Dc for pgsql-odbc@postgresql.org; Fri, 05 Dec 2014 12:06:54 +0000 Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 2079E28B13; Fri, 5 Dec 2014 04:06:51 -0800 (PST) Received: from EX13-CAS-010.vmware.com (EX13-CAS-010.vmware.com [10.113.191.62]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 0CECE40F3A; Fri, 5 Dec 2014 04:06:51 -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; Fri, 5 Dec 2014 04:07:20 -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 04:06:25 -0800 Message-ID: <54819FAC.7030103@vmware.com> Date: Fri, 5 Dec 2014 14:06:04 +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: Alvaro Herrera , Nathanael Terrien CC: "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> <20141205115919.GC1768@alvh.no-ip.org> In-Reply-To: <20141205115919.GC1768@alvh.no-ip.org> Content-Type: text/plain; charset="windows-1252"; 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-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 12/05/2014 01:59 PM, Alvaro Herrera wrote: > Now that I think about this, maybe the cache in your case is not being > useful for some reason or other, and it's causing more of a slowdown. > Is this plpgsql? If so, do you have EXCEPTION blocks in plpgsql code? > Maybe SAVEPOINTs somewhere? (Does the ODBC driver create SAVEPOINTs > automatically?) Ah, good point. psqlodbc does create SAVEPOINTs automatically, if you run in the "statement" "rollback on error" mode. That is, Protocol=*-2 mode. It is the default. You could try setting Protocol=7.4-0 in the config file (or set the corresponding option in the ODBC configuration GUI) and see if it helps. That changes the behaviour on errors, so that when an error happens the whole transaction is rolled back, rather than just the statement. I don't know if that's acceptable for your application, but if it is, you should change that setting, because that gets rid of the extra SAVEPOINT commands, and improves performance. Even if it turns out not to be the cause of the exponential slowdown. - Heikki -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc