Skip site navigation (1) Skip section navigation (2)

monitoring sort activities

From: Satoshi Nagayasu <nagayasus(at)nttdata(dot)co(dot)jp>
To: pgsql-patches(at)postgresql(dot)org
Cc: satoshi(dot)nagayasu(at)gmail(dot)com
Subject: monitoring sort activities
Date: 2005-09-24 06:07:12
Message-ID: 4334ED10.5060808@nttdata.co.jp (view raw or flat)
Thread:
Lists: pgsql-patches
Hi folks,

I've created a patch to get following TODO item.

> * %Add ability to monitor the use of temporary sort files

This patch provides one system view (pg_stat_sorts) and
one utility function (pg_stat_get_prev_sort_size).

> snaga=# SELECT * from pg_stat_sorts;
>  heap_all | index_all | datum_all | heap_tape | datum_tape | max_size
> ----------+-----------+-----------+-----------+------------+----------
>         4 |         6 |         0 |         4 |          0 | 26400000
> (1 row)
>
> snaga=# select aid from accounts where aid % 2 = 1 order by filler
desc limit 10;
>
> [...snip...]
>
> (10 rows)
>
> snaga=# SELECT pg_stat_get_prev_sort_size();
>  pg_stat_get_prev_sort_size
> ----------------------------
>                    13200000
> (1 row)

Yeah, I don't forget previous discussion with Tom. We also have to
monitor temp files, but I think these view and function will benefit
DBAs on performance tuning.

Any comments or suggestion?
-- 
NAGAYASU Satoshi <nagayasus(at)nttdata(dot)co(dot)jp>

Attachment: pg_stat_sorts.81b2.diff
Description: text/plain (16.8 KB)

pgsql-patches by date

Next:From: Tom LaneDate: 2005-09-24 17:13:00
Subject: Re: Proposed patch to clean up signed-ness warnings
Previous:From: Michael FuhrDate: 2005-09-24 03:02:54
Subject: Re: PL/Python error checking

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group