Re: [HACKERS] CREATE STATISTICS statistic_type documentation

2017-05-25 Thread Alvaro Herrera
Tom Lane wrote:
> Jeff Janes  writes:
> > On Thu, May 25, 2017 at 9:28 AM, Tom Lane  wrote:

> > If we invent more types in the future, would we expect those to be
> > defaulted to as well?
> 
> I might be wrong, but my impression is that the plan is to default
> to gathering all possible stats types.  So I'd probably write the
> addendum that way rather than naming those two types specifically.

Yes -- that plan has been hardcoded in ruleutils.c.

I'll patch.

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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] CREATE STATISTICS statistic_type documentation

2017-05-25 Thread Tom Lane
Jeff Janes  writes:
> On Thu, May 25, 2017 at 9:28 AM, Tom Lane  wrote:
>> Where would you expect to find that?

> Probably at the end of the paragraph:
> "A statistic type to be computed in this statistics object. Currently
> supported types are ndistinct, which enables n-distinct statistics, and
> dependencies, which enables functional dependency statistics. For more
> information, see Section 14.2.2 and Section 68.2."

Fair enough.

> Something like "If omitted, both ndistinct and dependencies will be
> included."

> If we invent more types in the future, would we expect those to be
> defaulted to as well?

I might be wrong, but my impression is that the plan is to default
to gathering all possible stats types.  So I'd probably write the
addendum that way rather than naming those two types specifically.

regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] CREATE STATISTICS statistic_type documentation

2017-05-25 Thread Jeff Janes
On Thu, May 25, 2017 at 9:28 AM, Tom Lane  wrote:

> Jeff Janes  writes:
> > The docs for CREATE STATISTICS does not say what happens if the
> > statistic_type clause is omitted.  It should probably say that the
> default
> > action is to create both ndistinct and dependencies.
>
> Hmm, I coulda sworn that it did say that somewhere.
>
> Where would you expect to find that?
>

Probably at the end of the paragraph:

"A statistic type to be computed in this statistics object. Currently
supported types are ndistinct, which enables n-distinct statistics, and
dependencies, which enables functional dependency statistics. For more
information, see Section 14.2.2 and Section 68.2."

Something like "If omitted, both ndistinct and dependencies will be
included."

If we invent more types in the future, would we expect those to be
defaulted to as well?

Cheers,

Jeff


Re: [HACKERS] CREATE STATISTICS statistic_type documentation

2017-05-25 Thread Tom Lane
Jeff Janes  writes:
> The docs for CREATE STATISTICS does not say what happens if the
> statistic_type clause is omitted.  It should probably say that the default
> action is to create both ndistinct and dependencies.

Hmm, I coulda sworn that it did say that somewhere.

Where would you expect to find that?

regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] CREATE STATISTICS statistic_type documentation

2017-05-25 Thread Jeff Janes
The docs for CREATE STATISTICS does not say what happens if the
statistic_type clause is omitted.  It should probably say that the default
action is to create both ndistinct and dependencies.

Cheers,

Jeff