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 4F04352E6F for ; Wed, 10 Aug 2005 21:36:43 -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 03660-02 for ; Thu, 11 Aug 2005 00:36:40 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 44DAD52E63 for ; Wed, 10 Aug 2005 21:36:40 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j7B0aZSg047037 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 10 Aug 2005 18:36:37 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j7B0aZgW069576; Wed, 10 Aug 2005 18:36:35 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j7B0aZIn069575; Wed, 10 Aug 2005 18:36:35 -0600 (MDT) (envelope-from mfuhr) Date: Wed, 10 Aug 2005 18:36:35 -0600 From: Michael Fuhr To: Dan Harris Cc: pgsql-performance@postgresql.org Subject: Re: Speedier count(*) Message-ID: <20050811003635.GA69508@winnie.fuhr.org> References: <3E43C7D5-9DB8-4132-BF4F-607B000866E1@drivefaster.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3E43C7D5-9DB8-4132-BF4F-607B000866E1@drivefaster.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=[AWL=0.005] X-Spam-Level: X-Archive-Number: 200508/103 X-Sequence-Number: 13850 On Wed, Aug 10, 2005 at 05:37:49PM -0600, Dan Harris wrote: > Also, I am using "select ... group by ... order by .. limit 1" to get > the min/max since I have already been bit by the issue of min() max() > being slower. PostgreSQL 8.1 will have optimizations for certain MIN and MAX queries. http://archives.postgresql.org/pgsql-committers/2005-04/msg00163.php http://archives.postgresql.org/pgsql-committers/2005-04/msg00168.php -- Michael Fuhr