Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id C78F61337B9C for ; Fri, 4 Feb 2011 13:45:30 -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 46827-06-2 for ; Fri, 4 Feb 2011 17:45:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp2.peak6.com (smtp2.peak6.com [38.98.137.9]) by mail.postgresql.org (Postfix) with ESMTP id 9DCAC1337B96 for ; Fri, 4 Feb 2011 13:45:23 -0400 (AST) X-AuditID: 0a02cb1e-b7bf8ae00000096d-67-4d4c3b32b76e Message-ID: <4D4C3B32.8070607@peak6.com> Date: Fri, 4 Feb 2011 11:45:22 -0600 From: Shaun Thomas Reply-To: sthomas@peak6.com Organization: Peak6 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7) Gecko/20100720 Lightning/1.0b2 Thunderbird/3.1.1 MIME-Version: 1.0 To: felix CC: "pgsql-performance@postgresql.org" Subject: Re: Really really slow select count(*) References: <4D4C138C.7010304@2ndquadrant.com> <4D4C1555.40209@peak6.com> <4D4C2AC3.5020804@peak6.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed content-transfer-encoding: 7bit X-Brightmail-Tracker: AAAAAQAAAZE= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/204 X-Sequence-Number: 42342 On 02/04/2011 11:38 AM, felix wrote: > CPU 0.00s/0.00u sec elapsed 0.00 sec. > INFO: analyzing "public.fastadder_fastadderstatus" > INFO: "fastadder_fastadderstatus": scanned 2492 of 2492 pages, > containing 154378 live rows and 0 dead rows; 30000 rows in sample, > 154378 estimated total rows > > and there's nothing at the end of the whole vacuum output about pages I'm not sure if it gives it to you if you pick a single DB, but if you use -a for all, you should get something at the very end like this: INFO: free space map contains 1365918 pages in 1507 relations DETAIL: A total of 1326656 page slots are in use (including overhead). 1326656 page slots are required to track all free space. Current limits are: 3000000 page slots, 3500 relations, using 38784 kB. VACUUM That's on our dev system. Your dev table seems properly sized, but prod probably isn't. If you run an all-database vacuum after-hours, you'll see the stuff at the end. And if your 'page slots are required' is greater than your 'page slots are in use,' you've got a problem. -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 800 | Chicago IL, 60604 312-676-8870 sthomas@peak6.com ______________________________________________ See http://www.peak6.com/email_disclaimer.php for terms and conditions related to this email