Re: tuple statistics function

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: tuple statistics function
Date: 2001-09-26 12:10:08
Message-ID: 200109261210.f8QCA8w01429@saturn.jw.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tatsuo Ishii wrote:
> Here is a revised version of pg_stattuple, which shows how many tuples
> are "dead" etc. Per Tom's suggestion, a statistic of free/resuable
> space is now printed.
>
> test=# select pgstattuple('accounts');
> NOTICE: physical length: 39.06MB live tuples: 100000 (12.59MB, 32.23%) dead tuples: 200000 (25.18MB, 64.45%) free/reusable space: 0.04MB (0.10%) overhead: 3.22%
> pgstattuple
> -------------
> 64.453125
>
> What I'm not sure is:
>
> o Should I place any kind of lock after reading buffer?
>
> o Should I use similar algorithm to the one used in vacuum to determin
> whether the tuple is "dead" or not?
>
> Suggestions?

A little unrelated to your question, but what about returning
an array of all the values and adding another argument to
suppress the NOTICE? That would IMHO make the function very
useful in administrative tools.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2001-09-26 12:43:22 Re: Unicode combining characters
Previous Message mlw 2001-09-26 11:50:25 Re: Converting from pgsql to sqlserver?