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 1mVgzv-0005JI-18 for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Sep 2021 21:20:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mVgzt-0002iy-S4 for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Sep 2021 21:20:13 +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 1mVgzt-0002ip-Jw for pgsql-hackers@lists.postgresql.org; Wed, 29 Sep 2021 21:20:13 +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 1mVgzr-0006cV-CM; Wed, 29 Sep 2021 21:20:13 +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 18TLK9vj3002520; Wed, 29 Sep 2021 17:20:09 -0400 From: Tom Lane To: David Rowley cc: David Rowley , Jaime Casanova , PostgreSQL-development Subject: Re: jsonb crash In-reply-to: References: <20210929185544.GB24346@ahch-to> <2998377.1632945612@sss.pgh.pa.us> <2999546.1632947043@sss.pgh.pa.us> <3001998.1632949788@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Thu, 30 Sep 2021 10:17:19 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3002518.1632950409.1@sss.pgh.pa.us> Date: Wed, 29 Sep 2021 17:20:09 -0400 Message-ID: <3002519.1632950409@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > On Thu, 30 Sept 2021 at 10:09, Tom Lane wrote: >> Um ... it seems to have correctly identified the cache key expressions, >> so why isn't it just doing exprType on those? The jsonb_exists operator >> seems entirely irrelevant here. > This is down to the caching stuff I added to RestrictInfo to minimise > the amount of work done during the join search. I cached the hash > equal function in RestrictInfo so I didn't have to check what that was > each time we consider a join. The problem is, that I did a bad job of > taking inspiration from check_hashjoinable() which just looks at the > left type. I'm still confused. AFAICS, the top-level operator of the qual clause has exactly nada to do with the cache keys, as this example makes plain. regards, tom lane