Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 9CA641336FA7 for ; Wed, 2 Feb 2011 12:05:16 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 57529-04 for ; Wed, 2 Feb 2011 16:05:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id 035A21337B5D for ; Wed, 2 Feb 2011 12:05:08 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p12G3bb09925; Wed, 2 Feb 2011 11:03:37 -0500 (EST) From: Bruce Momjian Message-Id: <201102021603.p12G3bb09925@momjian.us> Subject: Re: [PERFORM] Slow count(*) again... In-Reply-To: <5100.1296601964@sss.pgh.pa.us> To: Tom Lane Date: Wed, 2 Feb 2011 11:03:37 -0500 (EST) CC: Andrew Dunstan , Mladen Gogala , "david@lang.hm" , Craig Ringer , Vitalii Tymchyshyn , PostgreSQL-development X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/104 X-Sequence-Number: 180893 Tom Lane wrote: > Andrew Dunstan writes: > > On 02/01/2011 05:47 PM, Bruce Momjian wrote: > >> Tom Lane wrote: > >>> At this point what we've got is 25% of the runtime in nodeAgg.c overhead, > >>> and it's difficult to see how to get any real improvement without tackling > >>> that. > > >> Do we want a TODO about optimizing COUNT(*) to avoid aggregate > >> processing overhead? > > > Whether or not it's bad application design, it's ubiquitous, and we > > should make it work as best we can, IMNSHO. This often generates > > complaints about Postgres, and if we really plan for world domination > > this needs to be part of it. > > I don't think that saving ~25% on COUNT(*) runtime will help that at all. > The people who complain about it expect it to be instantaneous. > > If this sort of hack were free, I'd be all for doing it anyway; but I'm > concerned that adding tests to enable a fast path will slow down every > other aggregate, or else duplicate a lot of code that we'll then have to > maintain. OK, thank you. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +