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 1q94QC-0000PE-Ss for pgsql-performance@arkaria.postgresql.org; Tue, 13 Jun 2023 13:50:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q94QB-0006ws-C7 for pgsql-performance@arkaria.postgresql.org; Tue, 13 Jun 2023 13:50:55 +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 1q94QB-0006wi-2V for pgsql-performance@lists.postgresql.org; Tue, 13 Jun 2023 13:50:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q94Q7-0028wT-Ln for pgsql-performance@lists.postgresql.org; Tue, 13 Jun 2023 13:50:54 +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 35DDombB1527100; Tue, 13 Jun 2023 09:50:48 -0400 From: Tom Lane To: "James Pang (chaolpan)" cc: "pgsql-performance@lists.postgresql.org" Subject: Re: Postgresql equal join on function with columns not use index In-reply-to: References: <1166864.1686575919@sss.pgh.pa.us> Comments: In-reply-to "James Pang (chaolpan)" message dated "Mon, 12 Jun 2023 14:20:25 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1527098.1686664248.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 13 Jun 2023 09:50:48 -0400 Message-ID: <1527099.1686664248@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "James Pang (chaolpan)" writes: > Looks like it's the function "regexp_replace" volatile and restrict=3D= false make the difference, we have our application role with default sear= ch_path=3Doracle,$user,public,pg_catalog. = > =3D# select oid,proname,pronamespace::regnamespace,prosecdef,pro= isstrict,provolatile from pg_proc where proname=3D'regexp_replace' order b= y oid; > oid | proname | pronamespace | prosecdef | proisstrict | provo= latile > -------+----------------+--------------+-----------+-------------+------= ------- > 2284 | regexp_replace | pg_catalog | f | t | i > 2285 | regexp_replace | pg_catalog | f | t | i > 17095 | regexp_replace | oracle | f | f | v = > 17096 | regexp_replace | oracle | f | f | v > 17097 | regexp_replace | oracle | f | f | v > 17098 | regexp_replace | oracle | f | f | v Why in the world are the oracle ones marked volatile? That's what's preventing them from being used in index quals. regards, tom lane