Re: query produces 1 GB temp file

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Dirk Lutzebaeck <lutzeb(at)aeccom(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: query produces 1 GB temp file
Date: 2005-02-05 22:41:24
Message-ID: 29929.1107643284@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Greg Stark <gsstark(at)mit(dot)edu> writes:
> Dirk Lutzebaeck <lutzeb(at)aeccom(dot)com> 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Stark 2005-02-05 22:50:13 Re: query produces 1 GB temp file
Previous Message Greg Stark 2005-02-05 20:22:52 Re: query produces 1 GB temp file