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

From Peter Geoghegan
Subject Re: v13: show extended stats target in \d
Date
Msg-id CAH2-WzmzzTPfR7bpcdSJhkswvqF_4A6Me41-p0oz+=kMrMZ6Qw@mail.gmail.com
Whole thread Raw
In response to Re: v13: show extended stats target in \d  (Justin Pryzby <pryzby@telsasoft.com>)
List pgsql-hackers
On Sun, Sep 6, 2020 at 1:48 PM Justin Pryzby <pryzby@telsasoft.com> wrote:
> On Sun, Sep 06, 2020 at 01:06:05PM -0700, Peter Geoghegan wrote:
> > How about a line break? That seems like a simple solution that takes
> > all the competing concerns into account.

> Like this ?

> Statistics objects:
>     "public"."t" (ndistinct, dependencies, mcv) ON a, b FROM t

No, not like that.

ISTM that the problem with your original proposal is that it suggests
that it ought to be possible to add "STATISTICS 0" to the end of a
CREATE STATISTICS statement. That's not accurate, though. In reality
the only way to set the statistics target for a statistics object is
with ALTER STATISTICS. We should attempt to convey that difference
here.

More concretely, I was suggesting including a second line that's
similar to the following example output (iff the statistics target has
actually been set):

Statistics objects:
    "public"."t" (ndistinct, dependencies, mcv) ON a, b FROM t
    (STATISTICS 0)

Maybe some variation would be better -- the precise details are not
important. The new line conveys the fact that STATISTICS 0 is a part
of the object, but cannot appear in CREATE STATISTICS itself. That
seems like the right way of framing this.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Disk-based hash aggregate's cost model
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] audo-detect and use -moutline-atomics compilation flag for aarch64