Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 510D32E02EA for ; Wed, 5 Mar 2008 06:40:03 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 36203-01 for ; Wed, 5 Mar 2008 06:39:50 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by postgresql.org (Postfix) with ESMTP id 0EF692E0290 for ; Wed, 5 Mar 2008 06:39:54 -0400 (AST) Received: from trofast.ipv6.sesse.net ([2001:700:300:1803:20e:cff:fe36:a766] helo=trofast.sesse.net) by cassarossa.samfundet.no with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JWr2I-0000y1-4U; Wed, 05 Mar 2008 11:39:46 +0100 Received: from root by trofast.sesse.net with local (Exim 4.69) (envelope-from ) id 1JWr2H-0000ya-Fw; Wed, 05 Mar 2008 11:39:45 +0100 Date: Wed, 5 Mar 2008 11:39:45 +0100 From: "Steinar H. Gunderson" To: SPMLINGAM Cc: pgsql-performance@postgresql.org Subject: Re: postgresql performance Message-ID: <20080305103945.GA3673@uio.no> Mail-Followup-To: SPMLINGAM , pgsql-performance@postgresql.org References: <15847165.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <15847165.post@talk.nabble.com> X-Operating-System: Linux 2.6.20.4 on a x86_64 User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/70 X-Sequence-Number: 29024 On Wed, Mar 05, 2008 at 02:27:08AM -0800, SPMLINGAM wrote: > I have a table with 50 lakhs records, the table has more then 10 > fields, i have primary key, i have select query with count(*) without any > condition, it takes 17 seconds. Without knowing what a "lakhs" record is, it's pretty obvious that you haven't vacuumed in a very long time. Run VACUUM FULL on your tables, then instate regular (non-FULL) VACUUMs or enable autovacuum. /* Steinar */ -- Homepage: http://www.sesse.net/