X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1C5083A5452 for ; Thu, 2 Dec 2004 19:37:16 +0000 (GMT) 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 72724-08 for ; Thu, 2 Dec 2004 19:37:00 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id C6CAC3A54F8 for ; Thu, 2 Dec 2004 19:37:01 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id iB2JaxSU029228; Thu, 2 Dec 2004 14:36:59 -0500 (EST) To: Pallav Kalva Cc: pgsql-performance@postgresql.org Subject: Re: Poor Performance on a table In-reply-to: <41AF68F2.1050206@deg.cc> References: <41AF68F2.1050206@deg.cc> Comments: In-reply-to Pallav Kalva message dated "Thu, 02 Dec 2004 14:11:46 -0500" Date: Thu, 02 Dec 2004 14:36:59 -0500 Message-ID: <29227.1102016219@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200412/69 X-Sequence-Number: 9444 Pallav Kalva writes: > I have a table in my production database which has 500k rows and > from the pg_class it shows the number of "relpages" of > around 750K for this table, the same table copied to a test database > shows "relpages" as 35k. I run vacuumdb on the whole > database (not on the table individually but the whole database) daily. You're obviously suffering serious table bloat :-(. Depending on how heavy the update traffic on that table is, it might be that once-a-day vacuum is simply not often enough. Another likely problem is that you need to increase the FSM settings (how big is your whole database?) > Is there any way to fix this problem ? VACUUM FULL will fix the immediate problem. You might well find CLUSTER to be a faster alternative, though. regards, tom lane