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/reusablespace: 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@Yahoo.com #
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com