Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 504539FC2F4 for ; Fri, 18 May 2007 10:19:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 97858-05 for ; Fri, 18 May 2007 10:19:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from is.rice.edu (is.rice.edu [128.42.42.24]) by postgresql.org (Postfix) with ESMTP id B74F69FC2E5 for ; Fri, 18 May 2007 10:19:22 -0300 (ADT) Received: from scan2.mail.rice.edu (scan2.mail.rice.edu [128.42.59.161]) by is.rice.edu (Postfix) with ESMTP id 2F72E41822; Fri, 18 May 2007 08:19:21 -0500 (CDT) Received: from is.rice.edu ([128.42.42.24]) by scan2.mail.rice.edu (scan2.mail.rice.edu [128.42.59.161]) (amavisd-new, port 10024) with ESMTP id 27421-07; Fri, 18 May 2007 08:19:20 -0500 (CDT) Received: by is.rice.edu (Postfix, from userid 18612) id 6D31941820; Fri, 18 May 2007 08:19:20 -0500 (CDT) Date: Fri, 18 May 2007 08:19:20 -0500 From: Kenneth Marshall To: Jessica Richard Cc: pgsql-admin@postgresql.org Subject: Re: select count(*) from a large table is very slow Message-ID: <20070518131920.GA7069@it.is.rice.edu> References: <133912.35849.qm@web56406.mail.re3.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <133912.35849.qm@web56406.mail.re3.yahoo.com> User-Agent: Mutt/1.4.2i X-Virus-Scanned: by amavis-2.2.1 at scan2.mail.rice.edu X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/182 X-Sequence-Number: 25502 Make a summary table and select from there instead. Ken On Fri, May 18, 2007 at 06:15:25AM -0700, Jessica Richard wrote: > I have a ~30 milliow row table, select count(*) from this table is very very very slow... > > How dow I get it run faster? > > Thanks, > Jessica > > > --------------------------------- > We won't tell. Get more on shows you hate to love > (and love to hate): Yahoo! TV's Guilty Pleasures list.