X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7CF365372F; Sun, 24 Apr 2005 16:09:08 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55256-03; Sun, 24 Apr 2005 19:08:58 +0000 (GMT) Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by svr1.postgresql.org (Postfix) with ESMTP id D5D2B53ED8; Sun, 24 Apr 2005 16:08:53 -0300 (ADT) X-EthosMedia-Virus-Scanned: no infections found Received: from [63.195.55.98] (account josh@agliodbs.com HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 7279084; Sun, 24 Apr 2005 12:10:52 -0700 From: Josh Berkus Organization: Aglio Database Solutions To: Andrew Dunstan Subject: Re: [HACKERS] Bad n_distinct estimation; hacks suggested? Date: Sun, 24 Apr 2005 12:08:15 -0700 User-Agent: KMail/1.6.2 Cc: Tom Lane , Greg Stark , Marko Ristola , pgsql-perform , pgsql-hackers@postgresql.org References: <200504191209.05181.josh@agliodbs.com> <25382.1114318139@sss.pgh.pa.us> <426BDE32.4070004@dunslane.net> In-Reply-To: <426BDE32.4070004@dunslane.net> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200504241208.15437.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.009 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/666 X-Sequence-Number: 12063 Folks, > I wonder if this paper has anything that might help: > http://www.stat.washington.edu/www/research/reports/1999/tr355.ps - if I > were more of a statistician I might be able to answer :-) Actually, that paper looks *really* promising. Does anyone here have enough math to solve for D(sub)Md on page 6? I'd like to test it on samples of < 0.01%. Tom, how does our heuristic sampling work? Is it pure random sampling, or page sampling? -- Josh Berkus Aglio Database Solutions San Francisco