Re: Multi-column distinctness. - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: Multi-column distinctness.
Date
Msg-id 5626E303.5040300@2ndquadrant.com
Whole thread Raw
In response to Re: Multi-column distinctness.  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Multi-column distinctness.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On 10/20/2015 11:28 PM, Simon Riggs wrote:
> On 20 October 2015 at 16:48, Tomas Vondra <tomas.vondra@2ndquadrant.com
> <mailto:tomas.vondra@2ndquadrant.com>> wrote:>> On 10/20/2015 09:11 PM, Tom Lane wrote:
>>
>> Can't we just insist that there be only one statistics declaration
>> for a given column list? >>
>
> I would rather not, because I envision preferring different types of
> statistics for different types of queries. For example the statistics
> discussed in this particular thread only supports equality clauses,
> so this restriction would mean we can't also define histogram, we'll
> be unable to estimate queries with ranges.
>
>
> Can we do something like this...
>
> ADD STATISTICS ON (col list) USING (histogram, MFV)
> so we have Types/Methods of statistic, rather than specific names for
> the statistic entry?

That's how it works now (comparing columns and types of stats), but I 
find it awkward. That's why I proposed adding the name.

>
> Since this command doesn't actually ADD the statistics, it just creates
> a specification used by the next ANALYZE, it would seem better to use a
> different keyword than ADD, perhaps DECLARE STATISTICS ON... and DROP
> STATISTICS ON

Maybe, although we should not use DROP with DECLARE. Not only DROP has 
the same issue with name as ADD, but I think it's a good practice to 
commands "paired" ADD-DROP and DECLARE-X?

regards

--
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Freeze avoidance of very large table.
Next
From: Tom Lane
Date:
Subject: Re: Multi-column distinctness.