Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 5EFDF1337B68 for ; Thu, 3 Feb 2011 22:33:51 -0400 (AST) 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 73510-07 for ; Fri, 4 Feb 2011 02:33:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id B2AD91337B49 for ; Thu, 3 Feb 2011 22:33:43 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id 9BC89348025; Thu, 3 Feb 2011 18:33:43 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LUnrpV5fCiJE; Thu, 3 Feb 2011 18:33:41 -0800 (PST) Received: from [192.168.1.101] (71-94-248-62.dhcp.mdfd.or.charter.com [71.94.248.62]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 823D6348024; Thu, 3 Feb 2011 18:33:41 -0800 (PST) Subject: Re: [HACKERS] Slow count(*) again... From: "Joshua D. Drake" Reply-To: jd@commandprompt.com To: Conor Walsh Cc: Robert Haas , "pgsql-performance@postgresql.org" In-Reply-To: References: <201102012247.p11Ml6u02682@momjian.us> <4D48914B.4050403@dunslane.net> <4D489AD1.1010105@vmsinfo.com> <4D499E55.4020107@vmsinfo.com> <4D4A7B69.2020704@gmail.com> Content-Type: text/plain; charset="UTF-8" Organization: Command Prompt, Inc. Date: Thu, 03 Feb 2011 18:33:30 -0800 Message-ID: <1296786810.18411.102.camel@jd-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.594 tagged_above=-10 required=5 tests=BAYES_00=-1.9, TRACKER_ID=1.306 X-Spam-Level: X-Archive-Number: 201102/152 X-Sequence-Number: 42290 On Thu, 2011-02-03 at 18:12 -0800, Conor Walsh wrote: > > I can't remember > > anyone ever complaining "ANALYZE took too long to run". I only > > remember complaints of the form "I had to remember to manually run it > > and I wish it had just happened by itself". > > Robert, > > This sounds like an argument in favor of an implicit ANALYZE after all > COPY statements, and/or an implicit autoanalyze check after all > INSERT/UPDATE statements. Well that already happens. Assuming you insert/update or copy in a greater amount than the threshold for the autovacuum_analyze_scale_factor Then autovacuum is going to analyze on the next run. The default is .1 so it certainly doesn't take much. JD > > -Conor > -- PostgreSQL.org Major Contributor Command Prompt, Inc: http://www.commandprompt.com/ - 509.416.6579 Consulting, Training, Support, Custom Development, Engineering http://twitter.com/cmdpromptinc | http://identi.ca/commandprompt