pgsql: Show estimated number of groups for Incremental Sort in EXPLAIN - Mailing list pgsql-committers

From David Rowley
Subject pgsql: Show estimated number of groups for Incremental Sort in EXPLAIN
Date
Msg-id E1wtbJy-000000003d5-0SsV@gemulon.postgresql.org
Whole thread
List pgsql-committers
Show estimated number of groups for Incremental Sort in EXPLAIN

Incremental Sort's costs heavily depend on the estimated number of input
groups with equal presorted key values.  Overestimations can cause the
planner to choose Incremental Sort over Sort when Sort would have
been a better choice.

Here, we add the planner's estimate to EXPLAIN to allow easier
understanding of why Incremental Sort has been chosen.

Author: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>
Reviewed-by: Enrique Sánchez <enriqueesanchz@gmail.com>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: solai v <solai.cdac@gmail.com>
Discussion: https://postgr.es/m/10682fef-3748-43f5-a932-7adcdd9bd2b8%40tantorlabs.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/perform.sgml               |  1 +
src/backend/commands/explain.c          |  5 +++++
src/backend/optimizer/path/costsize.c   | 16 +++++++++++++---
src/backend/optimizer/plan/createplan.c |  4 +++-
src/backend/optimizer/util/pathnode.c   |  6 ++++--
src/include/nodes/pathnodes.h           |  1 +
src/include/nodes/plannodes.h           |  2 ++
src/include/optimizer/cost.h            |  3 ++-
8 files changed, 31 insertions(+), 7 deletions(-)


pgsql-committers by date:

Previous
From: Noah Misch
Date:
Subject: pgsql: Teach psql to skip in-line COPY ... FROM STDIN data after a fail
Next
From: Peter Eisentraut
Date:
Subject: pgsql: Remove useless ENABLE_NLS conditionals