pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Steven M. Wheeler <swheeler@sabre.com>
Cc: pgsql-sql@hub.org
Subject: Re: [SQL] Questions about vacuum analyze
Date: Fri, 08 Oct 1999 10:43:01 -0400
Message-ID: <3104.939393781@sss.pgh.pa.us> (raw)
In-Reply-To: <37FC8422.82295F9A@sabre.com>

"Steven M. Wheeler" <swheeler@sabre.com> writes:
> I am now running into another problem.  I need to do select distinct from the
> currnt to get dates for maintenance activity (rows to summarize and move to
> history).  When ever I do I get this message in my server.log file:

> NOTICE:  BufFileRead: should have flushed after writing

> And I get 0 records selected.

After some code browsing I have come up with a theory: is it possible
that you are running out of disk space during the sort?  I see psort.c
neglects to check for write failure :-(, although I am not entirely
clear on why that particular message and nothing else would come out
after it bulled ahead with an incomplete temporary file.

Sorting a large table seems to require temp disk space equal to several
times the size of the table.  Since you said your table is 40M rows,
I can easily believe you don't have that much free space...

I don't believe anyone has taken a hard look at psort.c in a long time.
I will try to dive into it and see if its resource consumption can't
be reduced.  Mergesort inherently requires 2X the original data space,
but it seems that psort is using even more than that, and perhaps this
can be improved.

			regards, tom lane



view thread (23+ messages)  latest in thread

Message-ID: <3104.939393781@sss.pgh.pa.us>
Permalink:  ../3104.939393781@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3104.939393781@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-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, swheeler@sabre.com, pgsql-sql@hub.org
  Subject: Re: [SQL] Questions about vacuum analyze
  In-Reply-To: <3104.939393781@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