Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 5E34E9FB573 for ; Tue, 10 Jul 2007 12:41:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 82623-01 for ; Tue, 10 Jul 2007 12:41:27 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id BE4AA9FB1E8 for ; Tue, 10 Jul 2007 12:41:27 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l6AFfKoD020268; Tue, 10 Jul 2007 11:41:21 -0400 (EDT) To: "Marc Mamin" cc: pgsql-performance@postgresql.org Subject: Re: tuning a function to insert/retrieve values from a reference table In-reply-to: References: Comments: In-reply-to "Marc Mamin" message dated "Tue, 10 Jul 2007 17:03:40 +0200" Date: Tue, 10 Jul 2007 11:41:20 -0400 Message-ID: <20267.1184082080@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/76 X-Sequence-Number: 25760 "Marc Mamin" writes: > Can I optimize this function with: > a) remove the EXCEPTION clause (Is there an underlying lock that prevent > concurrent inserts ?) No. > b) declare the function being IMMUTABLE ? Certainly not --- it's got side-effects. regards, tom lane