Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1okGsz-00044p-Fu for pgsql-general@arkaria.postgresql.org; Mon, 17 Oct 2022 03:33:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1okGsx-0005S5-RL for pgsql-general@arkaria.postgresql.org; Mon, 17 Oct 2022 03:33:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1okGsx-0005Rw-Gx for pgsql-general@lists.postgresql.org; Mon, 17 Oct 2022 03:33:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1okGsr-00047B-0M for pgsql-general@lists.postgresql.org; Mon, 17 Oct 2022 03:33:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 29H3XbFb2077795; Sun, 16 Oct 2022 23:33:38 -0400 From: Tom Lane To: "qiumingcheng" cc: "Julien Rouhaud" , "pgsql-general" Subject: Re: =?UTF-8?B?5Zue5aSN77yaQSBxdWVzdGlvbiBhYm91dCBsZWFrcHJvb2Y=?= In-reply-to: <9b7029cb-cd0d-494d-8628-93c7f8948117.qiumingcheng@aliyun.com> References: <9cc93fdc-2f99-4963-b895-169135b742a8.qiumingcheng@aliyun.com> <20221017014020.qpu2f5yy4lridhic@jrouhaud>,<2067840.1665971686@sss.pgh.pa.us> <9b7029cb-cd0d-494d-8628-93c7f8948117.qiumingcheng@aliyun.com> Comments: In-reply-to "qiumingcheng" message dated "Mon, 17 Oct 2022 10:50:38 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2077793.1665977617.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 16 Oct 2022 23:33:37 -0400 Message-ID: <2077794.1665977617@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "qiumingcheng" writes: > 1. In the test example I gave, the in4eq function's proleakproof=3Dtrue,= but its actual test result is leaking. Does that mean you will adjust it = to proleakproof=3Dfalse later? int4eq is about as leakproof as a function could possibly be: it does not leak, it's plain from the code of the function that it does not leak, and it calls no other code that might accidentally introduce a leak in future. I think you do not understand what that property actually means. Per the CREATE FUNCTION man page: LEAKPROOF indicates that the function has no side effects. It reveals no information about its arguments other than = by its return value. For example, a function which throws an error me= ssage for some argument values but not others, or which includes the argu= ment values in any error message, is not leakproof. Please note that this definition talks only about the behavior of the function itself. Re-reading your email, you seem to be imagining that changes in a query's plan on the basis of changes in collected statistics have something to do with this. They do not. regards, tom lane