Re: Group-count estimation statistics - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Group-count estimation statistics
Date
Msg-id 19990.1107188431@sss.pgh.pa.us
Whole thread Raw
In response to Re: Group-count estimation statistics  (Manfred Koizar <mkoi-pg@aon.at>)
Responses Re: Group-count estimation statistics  (Manfred Koizar <mkoi-pg@aon.at>)
List pgsql-hackers
Manfred Koizar <mkoi-pg@aon.at> writes:
> On Fri, 28 Jan 2005 10:53:33 -0500, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> we should consider
>> something like "clamp to size of table / 10" instead.

> ... unless a *single* grouping column is estimated to have more than
> N/10 distinct values, which should be easy to check.

Already done that way.
           /*            * Clamp to size of rel, or size of rel / 10 if multiple Vars.            * The fudge factor is
becausethe Vars are probably correlated            * but we don't know by how much.            */           double
 clamp = rel->tuples;
 
           if (relvarcount > 1)               clamp *= 0.1;           if (reldistinct > clamp)
reldistinct= clamp;
 

           regards, tom lane


pgsql-hackers by date:

Previous
From: Steve Atkins
Date:
Subject: Re: [BUGS] Bug in create operator and/or initdb
Next
From: Tom Lane
Date:
Subject: Re: 7.3.8 under FC3 takes excessive semaphores?