Re: new correlation metric

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org, npboley(at)gmail(dot)com
Subject: Re: new correlation metric
Date: 2008-10-26 20:31:28
Message-ID: 22941.1225053088@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Davis <pgsql(at)j-davis(dot)com> writes:
> On Sun, 2008-10-26 at 12:44 -0400, Tom Lane wrote:
>> We might need to invent some
>> other catalog besides pg_statistic if we want to represent per-index
>> properties like correlation.

> Why can't we just use pg_statistic with the starelid set to the index
> oid?

Well, because pg_statistic is built for per-column stats. You'd have to
invent some value for staattnum, which would be problematic for views
like pg_stats that expect it to join to a valid pg_attribute row;
and you'd have useless columns like stanullfrac and stadistinct.

There's no problem with using pg_statistic for stats that correspond to
individual index columns (and in fact we do that already); but ISTM
the point here is that correlation/ordering is about the index as a
whole, not any one column of it.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2008-10-27 00:24:17 Re: array_agg and array_accum (patch)
Previous Message Ian Caulfield 2008-10-26 20:08:51 Re: array_agg and array_accum (patch)