X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id E8AA3D1B4FC for ; Mon, 8 Sep 2003 13:15:15 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 45033-01 for ; Mon, 8 Sep 2003 10:14:47 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id A0ACCD1B4EB for ; Mon, 8 Sep 2003 10:14:43 -0300 (ADT) Received: (qmail 15119 invoked by uid 500); 8 Sep 2003 13:21:08 -0000 Date: Mon, 8 Sep 2003 08:21:08 -0500 From: Bruno Wolff III To: Vasilis Ventirozos Cc: Donald Fraser , pgsql-admin@postgresql.org Subject: Re: Are 50 million rows a problem for postgres ? Message-ID: <20030908132108.GD14906@wolff.to> Mail-Followup-To: Vasilis Ventirozos , Donald Fraser , pgsql-admin@postgresql.org References: <200309081032.51586.vendi@cosmoline.com> <001501c375f0$6d3b4eb0$1664a8c0@DEMOLITION> <200309081326.05261.vendi@cosmoline.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200309081326.05261.vendi@cosmoline.com> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/139 X-Sequence-Number: 10227 On Mon, Sep 08, 2003 at 13:26:05 +0300, Vasilis Ventirozos wrote: > This is a simple statement that i run > > core_netfon=# EXPLAIN select spcode,count(*) from callticket group by spcode; > QUERY PLAN > --------------------------------------------------------------------------------------- > Aggregate (cost=2057275.91..2130712.22 rows=979151 width=4) > -> Group (cost=2057275.91..2106233.45 rows=9791508 width=4) > -> Sort (cost=2057275.91..2081754.68 rows=9791508 width=4) > Sort Key: spcode > -> Seq Scan on callticket (cost=0.00..424310.08 rows=9791508 > width=4) > (5 rows) In addition to making the changes to the config file as suggested in other responses, you may also want to do some testing with the 7.4 beta. Hash aggreates will most likely speed this query up alot (assuming there aren't millions of unique spcodes). The production release of 7.4 will probably happen in about a month.