Re: sort_mem statistics ...

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: sort_mem statistics ...
Date: 2005-10-26 22:00:23
Message-ID: 20051026220023.GL16682@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 26, 2005 at 06:50:49PM -0300, Marc G. Fournier wrote:
> On Wed, 26 Oct 2005, Jim C. Nasby wrote:
>
> >On Tue, Oct 18, 2005 at 06:15:02PM -0400, Tom Lane wrote:
> >>"Marc G. Fournier" <scrappy(at)postgresql(dot)org> writes:
> >>>do we maintain anything anywhere for this? mainly, some way of
> >>>determining # of 'sorts to disk' vs 'sort in memory', to determine
> >>>whether
> >>>or not sort_mem is set to a good value?
> >>
> >>As of 8.1 you could turn on trace_sort to collect some data about this.
> >
> >While trace_sort is good, it doesn't really help for monitoring. What I
> >would find useful would be statistics along the lines of:
> >
> >How many sorts have occured?
> >How many spilled to disk?
> >What's the largest amount of memory used by an in-memory sort?
> >What's the largest amount of memory used by an on-disk sort?
>
> Actually, I'd like to see largest/smallest and average in this ... but if
> all is being logged to syslog, I can easily determine those #s with a perl
> script ..

True, but like I said that doesn't help much for monitoring. I'm
generally concerned with finding out when stuff starts spilling to disk.

Is there a way to log only queries that spill to disk?
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2005-10-26 22:36:25 Re: TRAP: FailedAssertion("!((itemid)->lp_flags & 0x01)", File: "nbtsearch.c", Line: 89)
Previous Message Jim C. Nasby 2005-10-26 21:59:17 Re: TRAP: FailedAssertion("!((itemid)->lp_flags & 0x01)", File: "nbtsearch.c", Line: 89)