pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PD_ALL_VISIBLE flag set - autovacuum ignoring dead tuples
2+ messages / 2 participants
[nested] [flat]

* PD_ALL_VISIBLE flag set - autovacuum ignoring dead tuples
@ 2011-08-03 14:23  Tom Lanyon <tom+pgsql-admin@oneshoeco.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Tom Lanyon @ 2011-08-03 14:23 UTC (permalink / raw)
  To: pgsql-admin


I'm seeing a heavy-update TOAST table which is not being effectively autovacuum'd on 8.4.5.  The stats collector shows n_dead_tup growing very quickly, and autovacuum runs frequently, but never removes any dead tuples.  A manual vacuum does find many dead tuples (90+ % of the table) to remove, and removes them properly.

Whilst debugging, I found that there seems to be a large amount of the old 'PD_ALL_VISIBLE incorrectly set...' warnings emitted during the autovacuum run.

My immediate assumption was that PD_ALL_VISIBLE is set on the page, and so autovacuum skips it.  However, from what I can see in lazy_scan_heap(), all of the clean-up actually happens before we even check the PD_ALL_VISIBLE flag and emit this warning.  Can anyone confirm that this is a warning message only, and shouldn't actually cause autovacuum to skip pruning dead tuples?

Am I seeing two different or related issues here?

Thanks,
Tom


p.s. I'm aware there was a change to PD_ALL_VISIBLE in 8.4.8 but that was to stop warning on a non-issue, so I don't believe it's the same.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: PD_ALL_VISIBLE flag set - autovacuum ignoring dead tuples
@ 2011-08-09 15:03  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Tom Lanyon <tom+pgsql-admin@oneshoeco.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2011-08-09 15:03 UTC (permalink / raw)
  To: Tom Lanyon <tom+pgsql-admin@oneshoeco.com>; +Cc: pgsql-admin

Tom Lanyon <tom+pgsql-admin@oneshoeco.com> writes:
> I'm seeing a heavy-update TOAST table which is not being effectively autovacuum'd on 8.4.5.  The stats collector shows n_dead_tup growing very quickly, and autovacuum runs frequently, but never removes any dead tuples.  A manual vacuum does find many dead tuples (90+ % of the table) to remove, and removes them properly.

Is autovacuum actually running against the toast table?  Check the
last_autovacuum column in pg_stat_all_tables.  If not, and if pg_class'
relpages/reltuples columns seem pretty out of date for the toast table,
this might be a variant of the problem reported here:
http://archives.postgresql.org/pgsql-admin/2011-05/msg00101.php
which was patched here:
http://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=b503da135ab0bdd97ac3d3f720...
although that patch hasn't actually made it into any shipping release
yet :-(

I'm not entirely convinced that you're seeing a related issue, because
Florian was complaining of too many autovacuums not too few, but if you
cross your eyes a bit and assume the symptom is "poor autovacuum
scheduling" then maybe the same problem explains both.

Another post-8.4.5 bug fix that could affect autovacuum's promptness is
http://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=fab2af30d6bb4ca893e2e9bf96...

> Whilst debugging, I found that there seems to be a large amount of the old 'PD_ALL_VISIBLE incorrectly set...' warnings emitted during the autovacuum run.

If that were the issue, manual vacuums would be subject to it too.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-08-09 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-08-03 14:23 PD_ALL_VISIBLE flag set - autovacuum ignoring dead tuples Tom Lanyon <tom+pgsql-admin@oneshoeco.com>
2011-08-09 15:03 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox