Re: On disable_cost - Mailing list pgsql-hackers

From Robert Haas
Subject Re: On disable_cost
Date
Msg-id CA+Tgmoa-nn+jypLTiG1BzOHLL1O-heSzyCrPPbw=Ah7McEex4A@mail.gmail.com
Whole thread Raw
In response to Re: On disable_cost  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: On disable_cost
List pgsql-hackers
On Tue, Jul 2, 2024 at 2:37 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
> > What happens right now is:
>
> > - If you set enable_indexscan=false, then disable_cost is added to the
> > cost of index scan paths and the cost of index-only scan paths.
>
> > - If you set enable_indexonlyscan=false, then index-only scan paths
> > are not generated at all.
>
> Hm.  The first part of that seems pretty weird to me --- why don't
> we simply not generate the paths at all?  There is no case AFAIR
> where that would prevent us from generating a valid plan.

Well, yeah.

What the patch does is: if you set either enable_indexscan=false or
enable_indexonlyscan=false, then the corresponding path type is not
generated, and the other is unaffected. To me, that seems like the
logical way to clean this up.

One could argue for other things, of course. And maybe those other
things are fine, if they're properly justified and documented.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: "Joel Jacobson"
Date:
Subject: Re: Optimize numeric multiplication for one and two base-NBASE digit multiplicands.
Next
From: Tom Lane
Date:
Subject: Re: On disable_cost