On Thu, Apr 09, 2020 at 01:48:55PM +0200, Tomas Vondra wrote:
> It it really any different from our enable_* GUCs? Even if you do e.g. > enable_sort=off, we may still do a sort. Same for enable_groupagg etc.
Those show that the GUC was disabled by showing disable_cost. That's what's different about this one.
Fwiw in the past this was seen not so much as a positive thing but a bug to be fixed. We've talked about carrying a boolean "disabled plan" flag which would be treated as a large cost penalty but not actually be added to the cost in the plan.
The problems with the disable_cost in the cost are (at least):
1) It causes the resulting costs to be useless for comparing the plan costs with other plans.
2) It can cause other planning decisions to be distorted in strange non-linear ways.