pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve statistics estimation for single-column GROUP BY in sub-
Date: Wed, 19 Feb 2025 09:59:48 +0000
Message-ID: <E1tkgrt-0006xK-0o@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1tkgrt-0006xK-0o@gemulon.postgresql.org>
Permalink:  ../E1tkgrt-0006xK-0o@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tkgrt-0006xK-0o@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: akorotkov@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Improve statistics estimation for single-column GROUP BY in sub-
  In-Reply-To: <E1tkgrt-0006xK-0o@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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