pgsql: Improve statistics estimation for single-column GROUP BY in sub- - Mailing list pgsql-committers

From Alexander Korotkov
Subject pgsql: Improve statistics estimation for single-column GROUP BY in sub-
Date
Msg-id E1tkgrt-0006xK-0o@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Improve statistics estimation for single-column GROUP BY in sub-queries

This commit follows the idea of the 4767bc8ff2.  If sub-query has only one
GROUP BY column, we can consider its output variable as being unique. We can
employ this fact in the statistics to make more precise estimations in the
upper query block.

Author: Andrei Lepikhov <lepihov@gmail.com>
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com>

Branch
------
master

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

Modified Files
--------------
src/backend/utils/adt/selfuncs.c        | 53 +++++++++++++++++++--------------
src/include/utils/selfuncs.h            |  3 +-
src/test/regress/expected/stats_ext.out | 15 ++++++++++
src/test/regress/sql/stats_ext.sql      | 12 ++++++++
4 files changed, 60 insertions(+), 23 deletions(-)


pgsql-committers by date:

Previous
From: Amit Kapila
Date:
Subject: pgsql: Add a test for commit ac0e33136a using the injection point.
Next
From: Álvaro Herrera
Date:
Subject: pgsql: Add ATAlterConstraint struct for ALTER .. CONSTRAINT