Brain-Dead Sort Algorithm??? - Mailing list pgsql-hackers

From Tim Perdue
Subject Brain-Dead Sort Algorithm???
Date
Msg-id 199912030234.SAA12533@www.geocrawler.com
Whole thread Raw
Responses Re: [HACKERS] Brain-Dead Sort Algorithm???
Re: [HACKERS] Brain-Dead Sort Algorithm???
List pgsql-hackers
This message was sent from Geocrawler.com by "Tim Perdue" <tim@perdue.net>
Be sure to reply to that address.

In the various versions of Postgres that I've
used, I've just been amazed at how stupid the
sorting process is.

I'm trying to SELECT DISTINCT on a table that is
60MB:

-rw-------   1 postgres postgres 89799976 Dec  2
20:27 pg_sorttemp32736.0
-rw-------   1 postgres postgres 87307680 Dec  2
20:27 pg_sorttemp32736.1
-rw-------   1 postgres postgres 84376872 Dec  2
20:27 pg_sorttemp32736.2
-rw-------   1 postgres postgres 78645944 Dec  2
20:27 pg_sorttemp32736.3
-rw-------   1 postgres postgres 66749412 Dec  2
20:27 pg_sorttemp32736.4
-rw-------   1 postgres postgres 71360512 Dec  2
20:29 pg_sorttemp32736.5
-rw-------   1 postgres postgres 260677944 Dec  2
20:28 pg_sorttemp32736.6


It uses over 1GB of disk space to do that sort,
and it would have used a lot more if I hadn't run
out.

Then it won't fail gracefully, instead of just
hangs and leaves temp files completely filling up
the hard drive.

How can it use 1GB of disk to sort a 60MB file?

Tim


Geocrawler.com - The Knowledge Archive


pgsql-hackers by date:

Previous
From: Vince Vielhaber
Date:
Subject: Re: [HACKERS] Neat article you will want to read.
Next
From: "Aaron J. Seigo"
Date:
Subject: Re: [HACKERS] Brain-Dead Sort Algorithm???