Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id D62782E01BC for ; Fri, 16 May 2008 05:19:46 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 40824-04 for ; Fri, 16 May 2008 05:19:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fhw-relay07.plus.net (fhw-relay07.plus.net [212.159.14.215]) by developer.postgresql.org (Postfix) with ESMTP id 4E81F2E0169 for ; Fri, 16 May 2008 04:40:20 -0300 (ADT) Received: from [84.51.143.99] (helo=server3.office.archonet.com) by fhw-relay07.plus.net with esmtp (Exim) id 1JwuY5-0001cT-9e; Fri, 16 May 2008 08:40:17 +0100 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 15AEF274059; Fri, 16 May 2008 08:40:17 +0100 (BST) Message-ID: <482D3A60.30006@archonet.com> Date: Fri, 16 May 2008 08:40:16 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: kevin kempter CC: pgsql-performance@postgresql.org Subject: Re: Join runs for > 10 hours and then fills up >1.3TB of disk space References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Plusnet-Relay: a96978cda62de919c9dbd13b8a3213ea X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/238 X-Sequence-Number: 30206 kevin kempter wrote: > Hi List; > > I have a table with 9,961,914 rows in it (see the describe of > bigtab_stats_fact_tmp14 below) > > I also have a table with 7,785 rows in it (see the describe of > xsegment_dim below) > > I'm running the join shown below and it takes > 10 hours and eventually > runs out of disk space on a 1.4TB file system > QUERY PLAN > --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Merge Join (cost=1757001.74..73569676.49 rows=3191677219 width=118) Dumb question Kevin, but are you really expecting 3.2 billion rows in the result-set? Because that's approaching 400GB of result-set without any overheads. -- Richard Huxton Archonet Ltd