Re: On disable_cost

David Rowley <dgrowleyml@gmail.com>

From: David Rowley <dgrowleyml@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>, Tom Lane <tgl@sss.pgh.pa.us>, Heikki Linnakangas <hlinnaka@iki.fi>, Peter Geoghegan <pg@bowt.ie>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-10-10T12:43:32Z
Lists: pgsql-hackers

Attachments

On Tue, 8 Oct 2024 at 04:14, Robert Haas <robertmhaas@gmail.com> wrote:
> I think you have adequate consensus to proceed with this. I'd just ask
> that you don't disappear completely if it turns out that there are
> problems. I accept that my commit created this problem and I'm
> certainly willing to be involved too if we need to sort out more
> things.

Thanks. I've attached a polished-up version of the earlier patch.

I spent quite a bit of time testing it by manually adjusting
disabled_nodes while attached with my debugger. Doing it that way was
easier as it's often hard and maybe sometimes not possible to get the
disabled node you want in a plan.

I'll loop back to the documentation part and Laruenz's patch after
this part is committed.

If anyone wants to take a look at the attached, please do so.
Otherwise, I'm pretty happy with it and will likely push it on New
Zealand Friday (aka later today).

David

Commits

  1. Doc: add detail about EXPLAIN's "Disabled" property

  2. Adjust EXPLAIN's output for disabled nodes

  3. Fix order of parameters in a cost_sort call

  4. Show number of disabled nodes in EXPLAIN ANALYZE output.

  5. Treat number of disabled nodes in a path as a separate cost metric.

  6. Remove grotty use of disable_cost for TID scan plans.