Re: new correlation metric - Mailing list pgsql-hackers

From Tom Lane
Subject Re: new correlation metric
Date
Msg-id 22941.1225053088@sss.pgh.pa.us
Whole thread Raw
In response to Re: new correlation metric  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
Jeff Davis <pgsql@j-davis.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


pgsql-hackers by date:

Previous
From: "Ian Caulfield"
Date:
Subject: Re: array_agg and array_accum (patch)
Next
From: Stephen Frost
Date:
Subject: Re: array_agg and array_accum (patch)