pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: gkokolatos@pm.me, pgsql-hackers@postgresql.org, Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Tatsuro Yamada <tatsuro.yamada.tf@nttcom.co.jp>
Subject: Re: v13: show extended stats target in \d
Date: Tue, 1 Sep 2020 17:08:25 -0400
Message-ID: <20200901210825.GA20170@alvherre.pgsql> (raw)
In-Reply-To: <20200901011429.GZ5450@telsasoft.com>

+1 on fixing this, since the ability to change stats target is new in
pg13.

On 2020-Aug-31, Justin Pryzby wrote:

> Maybe it should have a comma, like ", STATISTICS %s"?

It does need some separator.  Maybe a comma is sufficient, but I'm not
sure: that will fail when we add cross-relation stats, because the
FROM clause will have more relations and possibly have commas too.

                                    Table "public.ab1"
 Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description
--------+---------+-----------+----------+---------+---------+--------------+-------------
 a      | integer |           |          |         | plain   |              |
 b      | integer |           |          |         | plain   |              |
Statistics objects:
    "public"."ab1_a_b_stats" (ndistinct, dependencies, mcv) ON a, b FROM ab1


> Also, now I wonder if CREATE STATISTICS should support some syntax to set the
> initial target.  Like:
> 
> |CREATE STATISTICS abstats ON a,b FROM child.abc_202006 WITH(STATISTICS 111);

Umm, if true (on which I'm not sold), maybe it should appear in the
parenthesized list that currently is just the stats type list:

 |CREATE STATISTICS abstats (STATISTICS 111) ON a,b FROM child.abc_202006;

I'm not really convinced we need this.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (9+ messages)  latest in thread

Message-ID: <20200901210825.GA20170@alvherre.pgsql>
Permalink:  ../20200901210825.GA20170@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200901210825.GA20170@alvherre.pgsql

 · 

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-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, pryzby@telsasoft.com, tomas.vondra@2ndquadrant.com, tatsuro.yamada.tf@nttcom.co.jp
  Subject: Re: v13: show extended stats target in \d
  In-Reply-To: <20200901210825.GA20170@alvherre.pgsql>

* 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