Re: autovacuum and dead tuples

From: Shaun Thomas <sthomas(at)optionshouse(dot)com>
To: <fburgess(at)radiantblue(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: autovacuum and dead tuples
Date: 2013-09-18 16:27:35
Message-ID: 5239D477.7040602@optionshouse.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 09/18/2013 10:42 AM, fburgess(at)radiantblue(dot)com wrote:

> My colleague is under the impression that dead tuples are only cleaned up via vacuum
> full only, while I suggested that the autovaccum process was cleaning up
> these dead tuples. Is this true?

You are correct. Only VACUUM FULL (or CLUSTER) physically removes dead
tuples from the table, but a regular VACUUM enters them into the free
space map for reuse, so they wouldn't show up in the dead_tuple_count
column in pgstattuple. It's possible your colleague was confused by the
physical removal versus reassignment.

Keep in mind that the dead tuples are still in the table, but reusable.
The free_space column and free_percent is a better description of table
bloat from data turnover cleaned up by autovacuum.

--
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604
312-676-8870
sthomas(at)optionshouse(dot)com

______________________________________________

See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Brian Fehrle 2013-09-18 18:50:05 Re: View with and without ::text casting performs differently.
Previous Message fburgess 2013-09-18 15:42:42 autovacuum and dead tuples