Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id EFF259FC33E for ; Fri, 18 May 2007 10:22:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 88178-02 for ; Fri, 18 May 2007 10:22:40 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.229]) by postgresql.org (Postfix) with ESMTP id 99B329FC2EA for ; Fri, 18 May 2007 10:22:40 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id s1so1386275nze for ; Fri, 18 May 2007 06:22:39 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=fTFJAt+7fDMt6Xs4YY281aS4pkKNk4fIkm7uOSiFi4Wb6OFHaqUrhvduiSQXQpx5PjMC+0tYNF/IqcnEyTReSTHRzz4ECpJQAL0PcKZKR7x9CjzW1f7mFglQzqPFob5yhcx9WbCMyWhY1zwxbSZSBY4G4h5Z4FEfj0EM6f6/oSo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=h/NlkKR2EBvga0l33E3GoFzy4DxpWLZ890mHIGtoKukiw0wzkQM9xRaGkdb2+irPJnpzhdpdyK+iXKaBhfwbo4sCw+KJ9WQnGjKt7jG3pKbz1WhR0wtcaNFNBzIKtmjx46Wlfj4Km8G5V38j9G8Y+n3NhKz5wCAa57js1V62kbE= Received: by 10.114.205.1 with SMTP id c1mr834051wag.1179494558793; Fri, 18 May 2007 06:22:38 -0700 (PDT) Received: by 10.114.47.12 with HTTP; Fri, 18 May 2007 06:22:38 -0700 (PDT) Message-ID: <36e682920705180622t7e60d5e0rf4143d4af336967f@mail.gmail.com> Date: Fri, 18 May 2007 09:22:38 -0400 From: "Jonah H. Harris" To: "Jessica Richard" Subject: Re: select count(*) from a large table is very slow Cc: pgsql-admin@postgresql.org In-Reply-To: <133912.35849.qm@web56406.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <133912.35849.qm@web56406.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/184 X-Sequence-Number: 25504 On 5/18/07, Jessica Richard wrote: > I have a ~30 milliow row table, select count(*) from this table is very very > very slow... Yes, see the topic "Much Ado about COUNT(*)" > How dow I get it run faster? Unfortunately, aside from reducing the size of the table, you can't. -- Jonah H. Harris, Software Architect | phone: 732.331.1324 EnterpriseDB Corporation | fax: 732.331.1301 33 Wood Ave S, 3rd Floor | jharris@enterprisedb.com Iselin, New Jersey 08830 | http://www.enterprisedb.com/