Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yxm7T-0003q9-Jp for pgsql-bugs@arkaria.postgresql.org; Thu, 28 May 2015 00:56:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yxm7S-0008Up-KO for pgsql-bugs@arkaria.postgresql.org; Thu, 28 May 2015 00:56:22 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yxm7R-0008UB-Rb for pgsql-bugs@postgresql.org; Thu, 28 May 2015 00:56:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Yxm7O-0005jM-Mq for pgsql-bugs@postgresql.org; Thu, 28 May 2015 00:56:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t4S0uF7T016659; Wed, 27 May 2015 20:56:15 -0400 From: Tom Lane To: "Porte, Alexander" cc: "pgsql-bugs@postgresql.org" Subject: Re: Upsert functions spinlock when doing insert first. In-reply-to: References: Comments: In-reply-to "Porte, Alexander" message dated "Wed, 27 May 2015 21:39:48 -0000" Date: Wed, 27 May 2015 20:56:15 -0400 Message-ID: <16658.1432774575@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org "Porte, Alexander" writes: > We have simple upsert functions part of our ETL process. These upsert functions execute an insert and update from staging to datawarehouse tables and finally mark all these staged rows as processed, all within the same transaction. > In our tests and production we have encountered problems where these functions get stuck at full CPU with zero disk I/O. We were able to repro the problem on small dataset (<100'000 rows) with a single thread. We fiddled with settings following best practices, adding large amount of memory, increasing WAL segments, etc... to no avail. This is an interesting report, but you have not really provided enough detail to let anyone else reproduce the problem. Without sample data and a script for how to call the function, we're unlikely to duplicate your results. Also, as a general rule, we'd rather that supporting files were attached to the bug report, so that they get into the pgsql-bugs archives. A month from now when those privatepaste entries are gone, this report will mean nothing to anyone. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs