Re: Hash join explain is broken

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2019-06-11T08:22:20Z
Lists: pgsql-hackers
Hi,

On 2019-06-11 00:45:57 -0700, Andres Freund wrote:
> On 2019-06-10 21:28:12 +0300, Alexander Korotkov wrote:
> > After 5f32b29c explain of Hash Join sometimes triggers an error.
> >
> > Simple reproduction case is below.
> 
> Thanks for finding. I've created an open issue for now.

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...

If done properly, the expression would actually reside in the Hash node
itself, rather than ExecInitHashJoin() splitting up the join condition
itself, and moving it into the HashState.

Greetings,

Andres Freund



Commits

  1. Fix representation of hash keys in Hash/HashJoin nodes.