X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B953C8B9E9C for ; Sat, 5 Feb 2005 22:43:07 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55556-03 for ; Sat, 5 Feb 2005 22:42:50 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 772CE8B9E19 for ; Sat, 5 Feb 2005 22:41:34 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j15MfO9Y029930; Sat, 5 Feb 2005 17:41:25 -0500 (EST) To: Greg Stark Cc: Dirk Lutzebaeck , pgsql-performance@postgresql.org Subject: Re: query produces 1 GB temp file In-reply-to: <87y8e2kb8j.fsf@stark.xeocode.com> References: <20050205182117.0125074@mail2.aeccom.com> <87y8e2kb8j.fsf@stark.xeocode.com> Comments: In-reply-to Greg Stark message dated "05 Feb 2005 15:22:52 -0500" Date: Sat, 05 Feb 2005 17:41:24 -0500 Message-ID: <29929.1107643284@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/84 X-Sequence-Number: 10413 Greg Stark writes: > Dirk Lutzebaeck writes: >> Can some please explain why the temp file is so huge? I understand >> there are a lot of rows. > Well that I can't explain. 22k rows of width 1361 doesn't sound so big to me > either. It was 700k rows to sort, not 22k. The Unique/Limit superstructure only demanded 22k rows out from the sort, but we still had to sort 'em all to figure out which ones were the first 22k. > The temporary table does need to store three copies of the records at > a given time, but still it sounds like an awful lot. Huh? regards, tom lane