Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 98E9F6516E5 for ; Mon, 23 Jun 2008 10:49:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 06989-07 for ; Mon, 23 Jun 2008 10:49:34 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from anastacia.gransy.com (anastacia.gransy.com [89.187.130.100]) by postgresql.org (Postfix) with ESMTP id AB7AF6516CC for ; Mon, 23 Jun 2008 10:49:39 -0300 (ADT) Received: from sq.gransy.com (localhost [127.0.0.1]) by anastacia.gransy.com (Postfix) with ESMTP id 5EF5B31FDFE; Mon, 23 Jun 2008 15:50:14 +0200 (CEST) Received: from 217.77.161.17 (SquirrelMail authenticated user tv@fuzzy.cz) by sq.gransy.com with HTTP; Mon, 23 Jun 2008 15:50:14 +0200 (CEST) Message-ID: <20229.217.77.161.17.1214229014.squirrel@sq.gransy.com> In-Reply-To: <306870.66258.qm@web32707.mail.mud.yahoo.com> References: <306870.66258.qm@web32707.mail.mud.yahoo.com> Date: Mon, 23 Jun 2008 15:50:14 +0200 (CEST) Subject: Re: Postgresql is very slow From: tv@fuzzy.cz To: bijayant4u@yahoo.com Cc: pgsql-performance@postgresql.org User-Agent: SquirrelMail/1.4.10a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-2 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200806/106 X-Sequence-Number: 30456 Hi, > Hello to list, > > We have a CentOS-5 server with postgresql-8.1.8 installed. I am struggling > with postgresql performance. Any query say select * from tablename takes > 10-15 mins to give the output, and while executing the query system loads > goes up like anything. After the query output, system loads starts > decresing. I doubt the 'select * from tablename' is a good candidate for tuning, but give us more information about the table. What is it's size - how many rows does it have and how much space does it occupy on the disk? What is a typical usage of the table - is it modified (update / delete) frequently? How is it maintained - is there a autovacuum running, or did you set a routine vacuum (and analyze) job to maintain the database? I guess one of the servers (the slow one) is running for a long time without a proper db maintenance (vacuum / analyze) and you dumped / loaded the db onto a new server. So the 'new server' has much more 'compact' tables and thus gives the responses much faster. And this holds for more complicated queries (with indexes etc) too. An output from 'EXPLAIN' (or 'EXPLAIN ANALYZE') command would give a much better overview. Tomas