X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 69FA632A45A for ; Sat, 9 Oct 2004 05:13:36 +0100 (BST) 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 56422-01 for ; Sat, 9 Oct 2004 04:13:26 +0000 (GMT) Received: from fusion.bennyvision.com (fusion.bennyvision.com [216.161.119.28]) by svr1.postgresql.org (Postfix) with SMTP id 8C09932A0BE for ; Sat, 9 Oct 2004 05:13:25 +0100 (BST) Received: (qmail 9593 invoked from network); 9 Oct 2004 04:13:24 -0000 Received: from localhost (HELO webmail.stinkweasel.net) (127.0.0.1) by fusion.bennyvision.com with SMTP; 9 Oct 2004 04:13:24 -0000 Received: from 63.227.74.41 (SquirrelMail authenticated user benny); by webmail.stinkweasel.net with HTTP; Fri, 8 Oct 2004 23:13:02 -0500 (CDT) Message-ID: <50512.63.227.74.41.1097295204.squirrel@63.227.74.41> In-Reply-To: <23596.1097293763@sss.pgh.pa.us> References: <51319.63.227.74.41.1097293075.squirrel@63.227.74.41> <23596.1097293763@sss.pgh.pa.us> Date: Fri, 8 Oct 2004 23:13:02 -0500 (CDT) Subject: Re: Impact of foreign keys on a simple count(*) ? From: "C. Bensend" To: pgsql-sql@postgresql.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/57 X-Sequence-Number: 19160 > Foreign keys have zero, nada, zilch to do with the performance of > count(*). OK, I just wanted to make sure. > The only plausible theory I can think of for the performance > difference is that in your "new" database the table has been through > several mass updates, leading to a whole lot of dead rows and a much > larger physical table size to scan through. I'd suggest a VACUUM > VERBOSE on both old and new copies of the table to get an idea of the > relative physical sizes. You might need a VACUUM FULL to get the new > table back down to a reasonable size... Oh good lord. *waves the Idiot Flag as he slinks back under his rock* Thank you, Tom, for your patience. That was it. I'm a potatohead, but I'm learning. :) Benny, swearing he DID do a vacuum, but obviously not... -- "Even if a man chops off your hand with a sword, you still have two nice, sharp bones to stick in his eyes." -- .sig on Slashdot