Autovacuum and toast tables

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Autovacuum and toast tables
Date: 2007-08-05 21:59:20
Message-ID: 87y7gpiqx3.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


When autovacuum vacuums a table it always vacuums the toast table as well. Is
there any particular reason to consider the two together? I think this may
just be a holdover from the interactive command which considers them together
because the toast table is supposed to be invisible to users.

But autovacuum could look at the stats for the toast tables and make decisions
about them independently from the main tables, no?

The reason I ask is because looking in the logs from benchmarks I see lots of
useless vacuuming of empty toast tables which have no dead tuples. Now in this
case it doesn't cost anything because they're empty. But I could easily see
situations where the toast tables could be quite large but not be receiving
any updates when the main table is receiving a large volume of updates on
other columns.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-08-05 22:30:32 Re: pg_lzcompress strategy parameters
Previous Message Gustavo Tonini 2007-08-05 21:54:58 pgCluster CVS repository