Re: On disable_cost

Jelte Fennema-Nio <postgres@jeltef.nl>

From: Jelte Fennema-Nio <postgres@jeltef.nl>
To: Robert Haas <robertmhaas@gmail.com>
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:07:32Z
Lists: pgsql-hackers
On Wed, 31 Jul 2024 at 18:23, Robert Haas <robertmhaas@gmail.com> wrote:
> - If we do commit 0002, I think it's a good idea to have the number of
> disabled nodes displayed even with COSTS OFF, because it's stable, and
> it's pretty useful to be able to see this in the regression output. I
> have found while working on this that I often need to adjust the .sql
> files to say EXPLAIN (COSTS ON) instead of EXPLAIN (COSTS OFF) in
> order to understand what's happening. Right now, there's no real
> alternative because costs aren't stable, but disabled-node counts
> should be stable, so I feel this would be a step forward. Apart from
> that, I also think it's good for features to have regression test
> coverage, and since we use COSTS OFF everywhere or at least nearly
> everywhere in the regression test, if we don't print out the disabled
> node counts when COSTS OFF is used, then we don't cover that case in
> our tests. Bummer.

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)



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.