Re: log_duration - Mailing list pgsql-hackers

From Greg Stark
Subject Re: log_duration
Date
Msg-id 87ptpwlud8.fsf@stark.dyndns.tv
Whole thread Raw
In response to Re: log_duration  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
> Christopher Kings-Lynne wrote:
> > > Someone asked about this at FOSDEM. The only way I know to do it is look
> > > in the pgsql_temp directory, but they disappear pretty quickly.  Folks,
> > > do we need something to report sort file usage?

Fwiw here's the perl one-liner I used to tune sort_mem recently, 
(run in the $PGDATA/base directory):

perl -e 'while (sleep(1)) {if ($s = -s <pgsql_tmp/*>) { if ($s > $m) { $m = $s; print "$s\n"; } } }'

When doing this I had precisely the same thought about having Postgres print
out the disk space usage for sorts. 

-- 
greg



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Brain dump: btree collapsing
Next
From: Bruce Momjian
Date:
Subject: Re: Brain dump: btree collapsing