X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E6FDE528BB for ; Fri, 24 Jun 2005 06:53:55 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 00333-10 for ; Fri, 24 Jun 2005 09:53:49 +0000 (GMT) Received: from CISX-Linux4.cisx.com (unknown [213.133.202.58]) by svr1.postgresql.org (Postfix) with ESMTP id BEA6A528D9 for ; Fri, 24 Jun 2005 06:53:44 -0300 (ADT) Received: from DonAcer ([192.168.100.99]) by CISX-Linux4.cisx.com (8.12.8/8.12.8) with SMTP id j5O9rj1L003154 for ; Fri, 24 Jun 2005 10:53:46 +0100 Message-ID: <004801c578a2$9cfeb360$6364a8c0@DonAcer> From: "Donald Fraser" To: "[ADMIN]" References: <002301c577f7$28141780$6364a8c0@DonAcer> <4917.1119537183@sss.pgh.pa.us> Subject: Re: Are cached IMMUTABLE values persistent between sessions Date: Fri, 24 Jun 2005 10:53:44 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.056 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200506/190 X-Sequence-Number: 17945 > "Donald Fraser" writes: >> Is the returned value of a function defined as IMMUTABLE cached = >> globally? "Tom Lane" writes: > No, in fact it isn't cached at all. IMMUTABLE tells the planner that > it's OK to fold a function call with constant inputs to a constant > result value at plan time. Nothing more. Ok I'm sort of clutching at straws here... What about this scenario: I'm aware that sql statements within PL/pgSQL functions get cached. Therefore if the query planner can fold a function with a constant result, could that query plan get cached by PL/pgSQL with a folded value? Regards Donald Fraser