Re: Tupple statistics function

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Tupple statistics function
Date: 2001-09-22 04:58:41
Message-ID: 200109220458.f8M4wfk28070@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> Hi,
>
> I have written a small function that show how many tuples are dead
> etc. in a specified table. Example output is:
>
> test=# select pgstattuple('tellers');
> NOTICE: physical length: 0.02MB live tuples: 200 (0.01MB, 58.59%) dead tuples: 100 (0.00MB, 29.30%) overhead: 12.11%
> pgstattuple
> -------------
> 29.296875
> (1 row)
>
> Shall I add this function into contrib directory?

I have been wanting this for a long time. In fact, I wanted it linked
to VACUUM so you could vacuum a table only if it had >X% dead tuples.
Seems we can find a place for this in the existing commands. Not sure
where, though. Ideas?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-09-22 05:06:38 Re: Tupple statistics function
Previous Message Tatsuo Ishii 2001-09-22 04:36:47 Tupple statistics function

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-09-22 05:06:38 Re: Tupple statistics function
Previous Message Bruce Momjian 2001-09-22 04:56:45 Re: PostgreSQL funding/organization