Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbYN6-0004AL-DK for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jun 2019 22:39:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hbYN5-00057M-5F for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jun 2019 22:39:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbYN4-00057F-T3 for pgsql-hackers@lists.postgresql.org; Thu, 13 Jun 2019 22:39:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbYN1-0006gu-C2 for pgsql-hackers@postgresql.org; Thu, 13 Jun 2019 22:39:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x5DMcl9p023551; Thu, 13 Jun 2019 18:38:47 -0400 From: Tom Lane To: Andres Freund cc: Alexander Korotkov , pgsql-hackers Subject: Re: Hash join explain is broken In-reply-to: <20190611082220.eyhgjj47bj6jdkqp@alap3.anarazel.de> References: <20190611074557.bf6wejaj6ctrjxqd@alap3.anarazel.de> <20190611082220.eyhgjj47bj6jdkqp@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 11 Jun 2019 01:22:20 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23549.1560465527.1@sss.pgh.pa.us> Date: Thu, 13 Jun 2019 18:38:47 -0400 Message-ID: <23550.1560465527@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > I am too tired to look further into this. I suspect the only reason we > didn't previously run into trouble with the executor stashing hashkeys > manually at a different tree level with: > ((HashState *) innerPlanState(hjstate))->hashkeys > is that hashkeys itself isn't printed... TBH, I think 5f32b29c is just wrong and should be reverted for now. If there's a need to handle those expressions differently, it will require some cooperation from the planner not merely a two-line hack in executor startup. That commit didn't include any test case or other demonstration that it was solving a live problem, so I think we can leave it for v13 to address the issue. (But possibly we should add a test case similar to Nikita's, so that we don't overlook such problems in future.) regards, tom lane