Re: Multi-column distinctness.

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Multi-column distinctness.
Date: 2015-10-21 00:57:39
Message-ID: 5626E303.5040300@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/20/2015 11:28 PM, Simon Riggs wrote:
> On 20 October 2015 at 16:48, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com
> <mailto:tomas(dot)vondra(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-10-21 01:06:12 Re: Multi-column distinctness.
Previous Message Simon Riggs 2015-10-21 00:35:31 Re: Freeze avoidance of very large table.