X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 420BA5334C for ; Fri, 25 Mar 2005 02:34:21 +0000 (GMT) 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 48197-08 for ; Fri, 25 Mar 2005 02:34:11 +0000 (GMT) Received: from biglumber.com (biglumber.com [207.228.252.42]) by svr1.postgresql.org (Postfix) with SMTP id 5DC145371E for ; Fri, 25 Mar 2005 02:34:10 +0000 (GMT) Received: (qmail 30692 invoked from network); 25 Mar 2005 02:34:14 -0000 Received: from unknown (HELO localhost) (207.228.252.42) by 0 with SMTP; 25 Mar 2005 02:34:14 -0000 From: "Greg Sabino Mullane" To: pgsql-docs@postgresql.org Subject: Re: [PATCHES] Approximate count(*) X-PGP-Key: 2529 DF6A B8F7 9407 E944 45B4 BC9B 9067 1496 4AC8 X-Request-PGP: http://www.biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 In-Reply-To: <20050324175827.GC15848@fetter.org> Date: Fri, 25 Mar 2005 02:34:14 -0000 X-Mailer: JoyMail 1.48 Message-ID: <125db1c7753893171b6ef46609035de8@biglumber.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.148 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/17 X-Sequence-Number: 2913 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Fetter wrote: > Please find enclosed a patch that shows how to get a quick > approximation of count(*) on a table. You should mention that ANALYZE will also populate reltuples. To be real anal, you should say pg_catalog.pg_class too. :) Tom Lane asked: >> I'm not sure we should be encouraging people to look at reltuples... >> for one thing, it's deliberately a moving average under 8.0. > Should there be more caveats? Well, it already says "approximate", the value-laden word is "good". Perhaps if that went away... - -- Greg Sabino Mullane greg@turnstep.com PGP Key: 0x14964AC8 200503242126 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iD8DBQFCQ3iivJuQZxSWSsgRAm+PAKCNJPUl7Xns0kLKvbDjOiuNN2g4agCfbmg+ hX8RHO4R2Ad2fQyCPl+Ha3I= =2Gal -----END PGP SIGNATURE-----