agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Change GEQO fitness comparisons to consider disabled_nodes.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Change GEQO fitness comparisons to consider disabled_nodes.
@ 2026-09-17 13:47  Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Robert Haas @ 2026-09-17 13:47 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Change GEQO fitness comparisons to consider disabled_nodes.

Prior to v18, the total cost of a plan was just one number, a
floating-point value. Commit e22253467942fdb100087787c3e1e3a8620c54b2
introduced a second component, the number of disabled_nodes at or
below that level of the plan tree. Unfortunately, I (rhaas) failed
to realize that GEQO extracts the cost from each candidate plan and
compares it directly as a measure of fitness.

This means that, at least in principle, it's possible for GEQO to
prefer a plan with more disabled_nodes and lower cost over one with
fewer disabled_nodes and higher cost, which is incorrect. It may be
possible for that to become a practical issue in v18, but it's much
more likely to become an issue in v19 due to pg_plan_advice. Hence,
since the straightforward fix breaks ABI compatibility, back-patch
only to v19.

Backpatch-through: 19
Discussion: https://postgr.es/m/CA+TgmoYmXy-jiP5qDhqNEiYFEBzQsArO6O2d9E8szNZqi1bePQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c9c660e6ae03027615adff90cf4b26da5f8f97c1

Modified Files
--------------
src/backend/optimizer/geqo/geqo_eval.c | 18 ++++++++++------
src/backend/optimizer/geqo/geqo_main.c | 13 +++++++-----
src/backend/optimizer/geqo/geqo_misc.c | 19 +++++++++++------
src/backend/optimizer/geqo/geqo_pool.c | 29 ++++++++++---------------
src/include/optimizer/geqo.h           |  2 +-
src/include/optimizer/geqo_gene.h      | 39 +++++++++++++++++++++++++++++++++-
src/tools/pgindent/typedefs.list       |  1 +
7 files changed, 82 insertions(+), 39 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Change GEQO fitness comparisons to consider disabled_nodes.
@ 2026-09-17 13:47  Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Robert Haas @ 2026-09-17 13:47 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Change GEQO fitness comparisons to consider disabled_nodes.

Prior to v18, the total cost of a plan was just one number, a
floating-point value. Commit e22253467942fdb100087787c3e1e3a8620c54b2
introduced a second component, the number of disabled_nodes at or
below that level of the plan tree. Unfortunately, I (rhaas) failed
to realize that GEQO extracts the cost from each candidate plan and
compares it directly as a measure of fitness.

This means that, at least in principle, it's possible for GEQO to
prefer a plan with more disabled_nodes and lower cost over one with
fewer disabled_nodes and higher cost, which is incorrect. It may be
possible for that to become a practical issue in v18, but it's much
more likely to become an issue in v19 due to pg_plan_advice. Hence,
since the straightforward fix breaks ABI compatibility, back-patch
only to v19.

Backpatch-through: 19
Discussion: https://postgr.es/m/CA+TgmoYmXy-jiP5qDhqNEiYFEBzQsArO6O2d9E8szNZqi1bePQ@mail.gmail.com

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d22961bca2c8076c05546bf2fb83fdf5df81e843

Modified Files
--------------
src/backend/optimizer/geqo/geqo_eval.c | 18 ++++++++++------
src/backend/optimizer/geqo/geqo_main.c | 13 +++++++-----
src/backend/optimizer/geqo/geqo_misc.c | 19 +++++++++++------
src/backend/optimizer/geqo/geqo_pool.c | 29 ++++++++++---------------
src/include/optimizer/geqo.h           |  2 +-
src/include/optimizer/geqo_gene.h      | 39 +++++++++++++++++++++++++++++++++-
src/tools/pgindent/typedefs.list       |  1 +
7 files changed, 82 insertions(+), 39 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-09-17 13:47 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 13:47 pgsql: Change GEQO fitness comparisons to consider disabled_nodes. Robert Haas <rhaas@postgresql.org>
2026-09-17 13:47 pgsql: Change GEQO fitness comparisons to consider disabled_nodes. Robert Haas <rhaas@postgresql.org>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox