Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 729902E0064 for ; Fri, 16 May 2008 05:32:14 -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 48286-04 for ; Fri, 16 May 2008 05:32:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from pih-relay05.plus.net (pih-relay05.plus.net [212.159.14.132]) by developer.postgresql.org (Postfix) with ESMTP id 3405F2E0131 for ; Fri, 16 May 2008 05:16:25 -0300 (ADT) Received: from [84.51.143.99] (helo=server3.office.archonet.com) by pih-relay05.plus.net with esmtp (Exim) id 1Jwv6z-0003H8-7S; Fri, 16 May 2008 09:16:21 +0100 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id E0E3F27405A; Fri, 16 May 2008 09:16:19 +0100 (BST) Message-ID: <482D42D3.6000302@archonet.com> Date: Fri, 16 May 2008 09:16:19 +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: <482D3A60.30006@archonet.com> <8B5A9097-109E-45F5-A658-7FC723EA75F3@kevinkempterllc.com> In-Reply-To: <8B5A9097-109E-45F5-A658-7FC723EA75F3@kevinkempterllc.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Plusnet-Relay: 8a8b71fae8875d0b5fd738022a78e4bd X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/240 X-Sequence-Number: 30208 kevin kempter wrote: > I'm expecting 9,961,914 rows returned. Each row in the big table should > have a corresponding key in the smaller tale, I want to basically > "expand" the big table column list by one, via adding the appropriate > key from the smaller table for each row in the big table. It's not a > cartesion product join. Didn't seem likely, to be honest. What happens if you try the query as a cursor, perhaps with an order-by on customer_id or something to encourage index use? Do you ever get a first row back? In fact, what happens if you slap an index over all your join columns on xsegment_dim? With 7,000 rows that should make it a cheap test. -- Richard Huxton Archonet Ltd