Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T7boe-0003Fm-8d for pgsql-performance@postgresql.org; Sat, 01 Sep 2012 00:44:00 +0000 Received: from mail-pz0-f46.google.com ([209.85.210.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T7bod-0006LI-Ck for pgsql-performance@postgresql.org; Sat, 01 Sep 2012 00:43:59 +0000 Received: by dady13 with SMTP id y13so2300005dad.19 for ; Fri, 31 Aug 2012 17:43:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=iWQmGK/Nx4FZ7jk9jMwwSaGvxpUd4nRq7W7d0d2dRno=; b=GBxfy9ECuIywtJT5c3Xs7XeQZ2e5niLSoTweeovvBGnbjZTZ30+6KqjXL9NFcHLGF0 91d5JyY0KnQiErKfj1yhsu6mw0ktMeg/RstIsie+LShIzk6blK6FUG2BNq3USfeKkHt9 8+IXqsPEQyq3S1wiBpzDyPh3zgg5CGBb7rd+1313Z/utQjDfW6rIE+x5jciql6pg+IPq 5a9cy1nOlel7sQ+e3/j1teP6nSzkpYenNmYbSr3AajEUOaC0w9Htb1SdvunWhqoxtr6q P+2thWY7ZJXM+KYY1YviYVwc1J7PJslfWVFAaG9jxJYBCfiCO1AQ7jrMMCV8QVmofcPd oRpQ== Received: by 10.68.229.6 with SMTP id sm6mr20468773pbc.120.1346460237884; Fri, 31 Aug 2012 17:43:57 -0700 (PDT) Received: from ayaki.localdomain ([106.71.213.25]) by mx.google.com with ESMTPS id uj3sm4471537pbc.39.2012.08.31.17.43.53 (version=SSLv3 cipher=OTHER); Fri, 31 Aug 2012 17:43:55 -0700 (PDT) Message-ID: <50415A45.4060506@ringerc.id.au> Date: Sat, 01 Sep 2012 08:43:49 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Eileen CC: "pgsql-performance@postgresql.org" Subject: Re: JDBC 5 million function insert returning Single Transaction Lock Access Exclusive Problem References: <1346308496.83000.YahooMailNeo@web141101.mail.bf1.yahoo.com> In-Reply-To: <1346308496.83000.YahooMailNeo@web141101.mail.bf1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlDV1qmXYC2GswTVRJUjC4BNRjloKEV5bT09auJs9EuzC5nKL7P+Amnuv1JMRwgwDQ0VB60 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201209/1 X-Sequence-Number: 47747 On 08/30/2012 02:34 PM, Eileen wrote: > In my case, a few problems occurred. Number 1, the process ran at least > 8 hours and never finished. You're on a very old version of Pg, so you're missing out on a lot of improvements made since then. One of them is, if I recall correctly, an improvement to exception handling efficiency. Does your function use BEGIN ... EXCEPTION to (say) handle data validation errors? -- Craig Ringer