Re: Group-count estimation statistics

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Manfred Koizar <mkoi-pg(at)aon(dot)at>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Group-count estimation statistics
Date: 2005-01-31 16:20:31
Message-ID: 19990.1107188431@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Manfred Koizar <mkoi-pg(at)aon(dot)at> writes:
> On Fri, 28 Jan 2005 10:53:33 -0500, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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 because the 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-01-31 16:35:18 Re: 7.3.8 under FC3 takes excessive semaphores?
Previous Message Steve Atkins 2005-01-31 15:23:05 Re: [BUGS] Bug in create operator and/or initdb