Re: On disable_cost

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Jelte Fennema-Nio <postgres@jeltef.nl>
Cc: David Rowley <dgrowleyml@gmail.com>, 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-08-22T12:43:18Z
Lists: pgsql-hackers
On Thu, Aug 22, 2024 at 8:07 AM Jelte Fennema-Nio <postgres@jeltef.nl> wrote:
> Are the disabled node counts still expected to be stable even with
> GEQO? If not, maybe we should have a way to turn them off after all.
> Although I agree that always disabling them when COSTS OFF is set is
> probably also undesirable. How about a new option, e.g. EXPLAIN
> (DISABLED OFF)

Hmm, I hadn't thought about that. There are no GEQO-specific changes
in this patch, which AFAIK is OK, because I think GEQO just relies on
the core planning machinery to decide everything about the cost of
paths, and is really only experimenting with different join orders. So
I think if it picks the same join order, it should get the same count
of disabled nodes everywhere. If it doesn't pick the same order,
you'll get a different plan entirely.

I don't think I quite want to jump into inventing a new EXPLAIN option
right this minute. I'm not against the idea, but I don't want to jump
into engineering solutions before I understand what the problems are,
so I think we should give this a little time. I'll be a bit surprised
if this doesn't elicit a few strong reactions, but I want to see what
people are actually sad (or, potentially, happy) about.

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



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.