Re: Better estimates of index correlation

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: jd <jd(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Better estimates of index correlation
Date: 2011-03-14 14:14:25
Message-ID: 4D7E22C1.3090907@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14.03.2011 16:09, Alvaro Herrera wrote:
> Excerpts from Joshua D. Drake's message of dom mar 13 23:20:01 -0300 2011:
>> On Sun, 2011-03-13 at 19:40 -0400, Tom Lane wrote:
>>
>>> I'm not planning to do anything about this idea right now, since I'm
>>> still hip-deep in collations, but I thought I'd throw it out to get
>>> it on the record.
>>>
>>> Comments?
>>
>> One question: Where is the overhead increase?
>
> During VACUUM, in the pass that processes indexes.
>
> I think Tom is sligthly confused though: AFAICT this must happen in
> btvacuumscan (which does the actual scan), not btvacuumcleanup (which
> may not do it, if btbulkdelete did it previously). Which means it would
> be done for each pass over the index when vacuuming a relation, because
> I don't see any way for this function to determine whether this is the
> last pass we'll do over the index.
>
> It sure would be nice to be able to do it only during the last scan.

Can't we do it at ANALYZE? If the estimate is only based on intra-page
comparisons anyway, a sample of random pages ought to be enough.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-03-14 14:18:24 Re: Better estimates of index correlation
Previous Message Alvaro Herrera 2011-03-14 14:09:57 Re: Better estimates of index correlation