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.mele...@rentrak.com <vincent....@rentrakmail.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.

Reply via email to