Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 8EB209FB565 for ; Tue, 23 Jan 2007 13:59:59 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 04949-03 for ; Tue, 23 Jan 2007 13:59:56 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from wolff.to (wolff.to [66.93.197.194]) by postgresql.org (Postfix) with SMTP id F40FB9FB2B7 for ; Tue, 23 Jan 2007 13:59:55 -0400 (AST) Received: (qmail 25831 invoked by uid 500); 23 Jan 2007 17:59:51 -0000 Date: Tue, 23 Jan 2007 11:59:51 -0600 From: Bruno Wolff III To: Laurent Manchon Cc: pgsql-performance@postgresql.org Subject: Re: slow result Message-ID: <20070123175951.GC20870@wolff.to> Mail-Followup-To: Bruno Wolff III , Laurent Manchon , pgsql-performance@postgresql.org References: <5.0.2.1.2.20070123113422.00d189e8@pop.univ-montp2.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.0.2.1.2.20070123113422.00d189e8@pop.univ-montp2.fr> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/353 X-Sequence-Number: 22954 On Tue, Jan 23, 2007 at 11:34:52 +0100, Laurent Manchon wrote: > Hi, > > I have a slow response of my PostgreSQL database 7.4 using this query below > on a table with 800000 rows: > > select count(*)from tbl; > > PostgreSQL return result in 28 sec every time. > although MS-SQL return result in 0.02 sec every time. Besides the other advice mentioned in this thread, check that you don't have a lot of dead tuples in that table. 28 seconds seems a bit high for even a sequential scan of 800000 tuples unless they are pretty large.