Re: [COMMITTERS] pgsql: Teach tuplesort.c about "top N" sorting, in which only the first

From: Jim Nasby <decibel(at)decibel(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
Date: 2007-05-05 21:55:58
Message-ID: 0EFB5D10-9975-437C-BBC8-456E8375F98B@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On May 4, 2007, at 7:49 PM, Tom Lane wrote:
> Jim Nasby <decibel(at)decibel(dot)org> writes:
>> On a related note, it would also be *really* nice if we kept stats on
>> how many sorts or hashes had spilled to disk, perhaps along with how
>> much had spilled. Right now the only way to monitor that in a
>> production system is to setup a cron job to watch pgsql_tmp, which is
>> far from elegant.
>
> No, you can turn on trace_sort and track it from watching the log.
> If pgfouine hasn't got something for that already, I'd be surprised.

There's several problems with that. First, trace_sort isn't
documented (or at least it's not in postgresql.conf), so most folks
don't know it exists. Second, in order to see it's output you have to
drop log_min_messages to debug. That results in a huge log volume,
especially on a production system.

Aside from that, log files are not a good way to monitor performance,
they should be used for reporting on exception conditions. If the log
was meant to be the means for monitoring performance, then why have
the statistics system at all?

As for pgfouine, I've never been to a customer that knew what it was.
But almost all of them have other monitoring tools such as cricket,
MRTG and Nagios setup. Those that don't at least know they exist.
--
Jim Nasby jim(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2007-05-06 02:31:55 Re: pgsql: Check return code from strxfrm on Windows since it has a
Previous Message Magnus Hagander 2007-05-05 17:05:55 pgsql: Check return code from strxfrm on Windows since it has a

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2007-05-05 22:23:18 Re: temporal variants of generate_series()
Previous Message Jim Nasby 2007-05-05 21:54:41 Re: autovacuum starvation