pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mischa Sandberg <mischa.sandberg@telus.net>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: josh@agliodbs.com, pgsql-perform <pgsql-performance@postgresql.org>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Bad n_distinct estimation; hacks suggested?
Date: Tue, 26 Apr 2005 22:38:04 -0700
Message-ID: <1114580284.426f253cc0087@webmail.telus.net> (raw)
In-Reply-To: <426D565E.8040400@dunslane.net>
References: <200504191209.05181.josh@agliodbs.com>
	<19276.1114442580@sss.pgh.pa.us>
	<1114454941.21529.245.camel@localhost.localdomain>
	<200504251213.18565.josh@agliodbs.com>
	<426D565E.8040400@dunslane.net>

Quoting Andrew Dunstan <andrew@dunslane.net>: 
 
> After some more experimentation, I'm wondering about some sort of  
> adaptive algorithm, a bit along the lines suggested by Marko 
Ristola, but limited to 2 rounds. 
>  
> The idea would be that we take a sample (either of fixed size, or 
> some  small proportion of the table) , see how well it fits a larger 
sample 
> > (say a few times the size of the first sample), and then adjust 
the > formula accordingly to project from the larger sample the 
estimate for the full population. Math not worked out yet - I think we 
want to ensure that the result remains bounded by [d,N]. 
 
Perhaps I can save you some time (yes, I have a degree in Math). If I 
understand correctly, you're trying extrapolate from the correlation 
between a tiny sample and a larger sample. Introducing the tiny sample 
into any decision can only produce a less accurate result than just 
taking the larger sample on its own; GIGO. Whether they are consistent 
with one another has no relationship to whether the larger sample 
correlates with the whole population. You can think of the tiny sample 
like "anecdotal" evidence for wonderdrugs.  
--  
"Dreams come true, not free." -- S.Sondheim, ITW  




view thread (53+ messages)  latest in thread

Message-ID: <1114580284.426f253cc0087@webmail.telus.net>
Permalink:  ../1114580284.426f253cc0087@webmail.telus.net/
Also on:    postgresql.org/message-id/1114580284.426f253cc0087@webmail.telus.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: mischa.sandberg@telus.net, andrew@dunslane.net, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] Bad n_distinct estimation; hacks suggested?
  In-Reply-To: <1114580284.426f253cc0087@webmail.telus.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox