Re: benchmarking the query planner - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: benchmarking the query planner
Date
Msg-id 1229106717.8673.88.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: benchmarking the query planner  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: benchmarking the query planner
Re: benchmarking the query planner
List pgsql-hackers
On Fri, 2008-12-12 at 13:18 -0500, Tom Lane wrote:

> I seem to recall Greg suggesting that there were ways to estimate
> ndistinct without sorting, but short of a fundamental algorithm change
> there's not going to be a win here.

Hash table? Haas Stokes suggests a Bloom filter.

Why not keep the random algorithm we have now, but scan the block into a
separate hash table for ndistinct estimation. That way we keep the
correct random rows for other purposes.

> > Right now we may as well use a random number generator.
> 
> Could we skip the hyperbole please?

Some of the ndistinct values are very badly off, and in the common cases
I cited previously, consistently so.

Once I'm certain the rescue helicopter has seen me, I'll stop waving my
arms. (But yes, OK).

-- Simon Riggs           www.2ndQuadrant.comPostgreSQL Training, Services and Support



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Sync Rep: First Thoughts on Code
Next
From: Jeff Davis
Date:
Subject: Re: Sync Rep: First Thoughts on Code