Zero dead tuples, when significant apparent bloat

From: John Melesky <john(dot)melesky(at)rentrakmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Zero dead tuples, when significant apparent bloat
Date: 2013-12-11 01:05:26
Message-ID: CAJ1GNCotqp=9qyCJAwz_20Q769x5jZ5C7AgR-qg8xhaBbyfQUA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Here's the situation:

relation_size | indexes_size | total_relation_size
----------------+----------------+---------------------
997 MB | 2073 MB | 3070 MB
(1 row)

If I select n_dead_tup from pg_stat_user_tables, I get:

n_dead_tup
------------
0

Okay, so I run ANALYZE table, then check again:

n_dead_tup
------------
0

Finally, I run VACUUM FULL ANALYZE table. Now I see:

relation_size | indexes_size | total_relation_size
----------------+----------------+---------------------
118 MB | 200 MB | 319 MB
(1 row)

.... ?

It seems clear that there were dead tuples, since the table size shrank to
an eighth of its previous size. Why did analyze not pick that up?

Am I missing something?

This is a very large database, so we want to introspect against live/dead
tuple percentage to minimize the tables we run a VACUUM FULL against.

I've been staring at this for days.

-john

--
John Melesky | Sr Database Administrator
503.284.7581 x204 | john(dot)melesky(at)rentrak(dot)com <vincent(dot)lau(at)rentrakmail(dot)com>
RENTRAK | www.rentrak.com | NASDAQ: RENT

Notice: This message is confidential and is intended only for the
recipient(s) named above. If you have received this message in error,
or are not the named recipient(s), please immediately notify the
sender and delete this message.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message bricklen 2013-12-11 01:57:24 Re: Zero dead tuples, when significant apparent bloat
Previous Message Jerry Sievers 2013-12-10 22:59:50 Re: validate synatax