pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Stark <gsstark@mit.edu>
Cc: Dirk Lutzebaeck <lutzeb@aeccom.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: query produces 1 GB temp file
Date: Sat, 05 Feb 2005 17:41:24 -0500
Message-ID: <29929.1107643284@sss.pgh.pa.us> (raw)
In-Reply-To: <87y8e2kb8j.fsf@stark.xeocode.com>
References: <20050205182117.0125074@mail2.aeccom.com>
	<87y8e2kb8j.fsf@stark.xeocode.com>

Greg Stark <gsstark@mit.edu> writes:
> Dirk Lutzebaeck <lutzeb@aeccom.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



view thread (24+ messages)  latest in thread

Message-ID: <29929.1107643284@sss.pgh.pa.us>
Permalink:  ../29929.1107643284@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29929.1107643284@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, gsstark@mit.edu, lutzeb@aeccom.com
  Subject: Re: query produces 1 GB temp file
  In-Reply-To: <29929.1107643284@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox