From: Josh Berkus <josh@agliodbs.com>
To: Mischa Sandberg <mischa.sandberg@telus.net>
Cc: Markus Schaber <schabi@logix-tt.com>
Cc: pgsql-perform <pgsql-performance@postgresql.org>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [PERFORM] Bad n_distinct estimation; hacks suggested?
Date: Tue, 3 May 2005 14:43:44 -0700
Message-ID: <200505031443.44859.josh@agliodbs.com> (raw)
In-Reply-To: <1115155990.4277ee16aba34@webmail.telus.net>
References: <200504191209.05181.josh@agliodbs.com>
<4277774F.7040205@logix-tt.com>
<1115155990.4277ee16aba34@webmail.telus.net>
Mischa,
> Okay, although given the track record of page-based sampling for
> n-distinct, it's a bit like looking for your keys under the streetlight,
> rather than in the alley where you dropped them :-)
Bad analogy, but funny.
The issue with page-based vs. pure random sampling is that to do, for example,
10% of rows purely randomly would actually mean loading 50% of pages. With
20% of rows, you might as well scan the whole table.
Unless, of course, we use indexes for sampling, which seems like a *really
good* idea to me ....
--
--Josh
Josh Berkus
Aglio Database Solutions
San Francisco
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: josh@agliodbs.com, mischa.sandberg@telus.net, schabi@logix-tt.com, pgsql-hackers@postgresql.org
Subject: Re: [PERFORM] Bad n_distinct estimation; hacks suggested?
In-Reply-To: <200505031443.44859.josh@agliodbs.com>
* 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