Re: Why enable_hashjoin Completely disables HashJoin

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Quan Zongliang <quanzongliang(at)yeah(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why enable_hashjoin Completely disables HashJoin
Date: 2023-04-03 12:13:34
Message-ID: 1196893.1680524014@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Quan Zongliang <quanzongliang(at)yeah(dot)net> writes:
> I found that the enable_hashjoin disables HashJoin completely.

Well, yeah. It's what you asked for.

> Instead, it should add a disable cost to the cost calculation of
> hashjoin.

Why? The disable-cost stuff is a crude hack that we use when
turning off a particular plan type entirely might render us
unable to generate a valid plan. Hash join is not in that
category.

> After disabling all three, the HashJoin path should still be chosen.

Why?

Personally, I'd get rid of disable_cost altogether if I could.
I'm not in a hurry to extend its use to more places.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2023-04-03 12:25:59 Re: hio.c does visibilitymap_pin()/IO while holding buffer lock
Previous Message David Rowley 2023-04-03 11:56:57 Re: Option to not use ringbuffer in VACUUM, using it in failsafe mode