Re: Why enable_hashjoin Completely disables HashJoin

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Quan Zongliang <quanzongliang(at)yeah(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why enable_hashjoin Completely disables HashJoin
Date: 2023-04-03 23:31:55
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> It sounds too hard compared to the gains, but another way could be to plan
> with the relevant path generation hard disabled, and plan from scratch, with
> additional scan types enabled, if we end up being unable to generate valid
> plan.

Actually, I kind of like that. It would put the extra cost in a place
it belongs: if you have enough enable_foo turned off to prevent
generating a valid plan, it'll cost you extra to make a plan ... but
likely you'll be paying even more in runtime due to not getting a good
plan, so maybe that doesn't matter anyway. I'd limit it to two passes:
first try honors all enable_foo switches, second try ignores all.

I'm not quite sure how this could be wedged into the existing code
structure --- in particular I am not sure that we're prepared to do
two passes of baserel path generation. (GEQO is an existence proof
that we could handle it for join planning, though.)

Or we could rethink the design goal of not allowing enable_foo switches
to cause us to fail to make a plan. That might be unusable though.

regards, tom lane

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-04-03 23:39:14 Re: Why enable_hashjoin Completely disables HashJoin
Previous Message David Rowley 2023-04-03 23:31:04 Re: Why enable_hashjoin Completely disables HashJoin