Re: v13: show extended stats target in \d - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: v13: show extended stats target in \d
Date
Msg-id 20200901011429.GZ5450@telsasoft.com
Whole thread Raw
In response to Re: v13: show extended stats target in \d  (gkokolatos@pm.me)
Responses Re: v13: show extended stats target in \d  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On Mon, Aug 31, 2020 at 07:47:35AM +0000, gkokolatos@pm.me wrote:
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Monday, 31 August 2020 08:00, Justin Pryzby <pryzby@telsasoft.com> wrote:
> 
> > The stats target can be set since commit d06215d03, but wasn't shown by psql.
> > ALTER STATISISTICS .. SET STATISTICS n.
> >
> > Normal (1-D) stats targets are shown in \d+ table.
> > Stats objects are shown in \d (no plus).
> > Arguably, this should be shown only in "verbose" mode (\d+).
> 
> This seems rather useful. May I suggest you add it to the commitfest?

I added at
https://commitfest.postgresql.org/29/2712/

+           appendPQExpBuffer(&buf, " STATISTICS %s",

Maybe it should have a comma, like ", STATISTICS %s"?
Similar to these:

        appendPQExpBuffer(&buf, ", ON TABLE %s",
|Triggers:
|    trg1 AFTER INSERT ON trigpart3 FOR EACH ROW EXECUTE FUNCTION trigger_nothing(), ON TABLE trigpart

and:
    appendPQExpBufferStr(&buf, ", PARTITIONED");
|part_ee_ff FOR VALUES IN ('ee', 'ff'), PARTITIONED,

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

-- 
Justin



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Remove line length restriction in passwordFromFile()
Next
From: Tatsuro Yamada
Date:
Subject: Re: v13: show extended stats target in \d