X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4F4B152990 for ; Fri, 8 Jul 2005 13:50:23 -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 97993-08 for ; Fri, 8 Jul 2005 16:50:08 +0000 (GMT) Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id 4D8C452A99 for ; Fri, 8 Jul 2005 13:50:07 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 4F34F30B41; Fri, 8 Jul 2005 18:54:09 +0200 (MET DST) From: Christopher Browne X-Newsgroups: pgsql.sql Subject: Re: Make COUNT(*) Faster? Date: Fri, 08 Jul 2005 13:09:29 -0400 Organization: cbbrowne Computing Inc Lines: 26 Message-ID: References: <9EF2931D-1097-470D-8ECB-59D00166C96F@apple.com> <60vf3mklue.fsf@dba2.int.libertyrms.com> <42CE89CA.2070607@noao.edu> <20050708143508.GD22725@wolff.to> <42CE96AF.3020903@noao.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, berkeley-unix) Cancel-Lock: sha1:PhmFbpZKg3vUWbbyCcNPUd9HBmo= To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.375 tagged_above=0 required=5 tests=AWL, INFO_TLD X-Spam-Level: X-Archive-Number: 200507/86 X-Sequence-Number: 22064 > I'm also claiming that a true count for any active table is > meaningless and am *not* suggesting that effort be spent on trying > to produce such a true count. That's a pretty big assumption that would in fact be WRONG. We have managers interested in counting the number of objects we have around (As a domain registry, what objects would you imagine those might be :-)), and they're keen on possibly even being able to reconcile those counts from day to day based on transaction activity. Leaping into some sort of vague guesstimation would destroy the ability to do any kind of analysis of activity, and I daresay enrage them. There may be times that a really rough guess can suffice; there are other times when exactness is absolutely vital. Creating a "fast but WRONG COUNT(*)" which prevented getting the exact answer that the present implementation provides would be a severe misfeature. -- output = reverse("gro.gultn" "@" "enworbbc") http://linuxdatabases.info/info/rdbms.html "The test of a principle is whether it applies even to people you don't like." -- Henry Spencer