Quan Zongliang <quanzongliang@yeah.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