pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add pg_stats_ext view for extended statistics
Date: Sat, 15 Jun 2019 23:21:16 +0000
Message-ID: <E1hcHz2-0005ma-5H@gemulon.postgresql.org> (raw)

Add pg_stats_ext view for extended statistics

Regular per-column statistics are stored in pg_statistics catalog, which
is however rather difficult to read, so we also have pg_stats view with
a human-reablable version of the data.

For extended statistic the catalog was fairly easy to read, so we did
not have such human-readable view so far.  Commit 9b6babfa2d however did
split the catalog into two, which makes querying harder.  Furthermore,
we want to show the multi-column MCV list in a way similar to per-column
stats (and not as a bytea value).

This commit introduces pg_stats_ext view, joining the two catalogs and
massaging the data to produce human-readable output similar to pg_stats.
It also considers RLS and access privileges - the data is shown only when
the user has access to all columns the extended statistic is defined on.

Bumped CATVERSION due to adding new system view.

Author: Dean Rasheed, with improvements by me
Reviewed-by: Dean Rasheed, John Naylor
Discussion: https://postgr.es/m/CAEZATCUhT9rt7Ui%3DVdx4N%3D%3DVV5XOK5dsXfnGgVOz_JhAicB%3DZA%40mail.gmail.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/catalogs.sgml           | 192 +++++++++++++++++++++++++++++++++++
src/backend/catalog/system_views.sql |  41 ++++++++
src/include/catalog/catversion.h     |   2 +-
src/test/regress/expected/rules.out  |  29 ++++++
4 files changed, 263 insertions(+), 1 deletion(-)



Message-ID: <E1hcHz2-0005ma-5H@gemulon.postgresql.org>
Permalink:  ../E1hcHz2-0005ma-5H@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hcHz2-0005ma-5H@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tomas.vondra@postgresql.org
  Subject: Re: pgsql: Add pg_stats_ext view for extended statistics
  In-Reply-To: <E1hcHz2-0005ma-5H@gemulon.postgresql.org>
  References: <E1hcHz2-0005ma-5H@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