Thread: Temporary sorting space

Temporary sorting space

From
Richard Boyes
Date:
Hello all,

Inside the $PGDATA/base/thedatabase I came across a rather
large file called pg_sorttemp28193.0 (~ 587 MB). Our datbase
is not anywhere near this large, so I can only guess this was
a query gone awry that needed a large amount of sorting space.
Around the time this file was created the database server
also crashed, I'm wondering if this was a cause of it
(the server crashed due to a memory problem). Could that be possible ?

Also, would I now be safe in removing this file ?

Thanks
Richard.

--
Richard Boyes           Tel: 64 09 373 7599 x3055
University of Auckland  Fax: 64 09 373 7468

Re: Temporary sorting space

From
will trillich
Date:
On Wed, Mar 07, 2001 at 04:11:23PM +1300, Richard Boyes wrote:
> Hello all,
>
> Inside the $PGDATA/base/thedatabase I came across a rather
> large file called pg_sorttemp28193.0 (~ 587 MB). Our datbase
> is not anywhere near this large, so I can only guess this was
> a query gone awry that needed a large amount of sorting space.
> Around the time this file was created the database server
> also crashed, I'm wondering if this was a cause of it
> (the server crashed due to a memory problem). Could that be possible ?
>
> Also, would I now be safe in removing this file ?

i'm not much of a guru, but here's how i'd test the safety of
removing any file:

    rename it or put it into a
    subdirectory of wherever it is now.

then restart your pg engine and see if something breaks. test
heavily. after a backup, and a week of no troubles, zap your file.
if something breaks, put it back!

--
It is always hazardous to ask "Why?" in science, but it is often
interesting to do so just the same.
        -- Isaac Asimov, 'The Genetic Code'

will@serensoft.com
http://newbieDoc.sourceforge.net/ -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

Re: Temporary sorting space

From
Tom Lane
Date:
Richard Boyes <r.boyes@auckland.ac.nz> writes:
> Inside the $PGDATA/base/thedatabase I came across a rather
> large file called pg_sorttemp28193.0 (~ 587 MB). Our datbase
> is not anywhere near this large, so I can only guess this was
> a query gone awry that needed a large amount of sorting space.
> Around the time this file was created the database server
> also crashed, I'm wondering if this was a cause of it
> (the server crashed due to a memory problem). Could that be possible ?

Possibly, but this is not a lot of evidence.  Can you provide any
log file entries, core dump backtraces, etc?

> Also, would I now be safe in removing this file ?

If there's not currently a backend with PID 28193, then that's a
dead file.  Zap away.

            regards, tom lane