Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id D504CB5D91F for ; Tue, 1 Nov 2011 19:51:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 08307-04 for ; Tue, 1 Nov 2011 22:51:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id B00BBB5DCC9 for ; Tue, 1 Nov 2011 19:51:07 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id pA1Mp20p026834; Tue, 1 Nov 2011 18:51:03 -0400 (EDT) To: Josh Kupershmidt cc: pgsql-docs Subject: Re: docs update for count(*) and index-only scans In-reply-to: References: Comments: In-reply-to Josh Kupershmidt message dated "Tue, 01 Nov 2011 18:26:37 -0400" Date: Tue, 01 Nov 2011 18:51:02 -0400 Message-ID: <26833.1320187862@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.101 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-1.201 X-Spam-Level: X-Archive-Number: 201111/2 X-Sequence-Number: 7077 Josh Kupershmidt writes: > func.sgml still claims that a sequential scan is the only way to > execute a SELECT COUNT(*) query. I think this note should just be > removed from the current docs, given the existence of index-only > scans; patch attached. Well, it might need adjustment, but I don't think we should remove it outright. The people who complain that COUNT(*) is not O(1) are still going to be complaining. On tables that are not read-mostly, there's no reason to expect that index-only scans will even provide a material speed boost, let alone be close to free. regards, tom lane