Clarify vacuum verbose message

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Clarify vacuum verbose message
Date: 2015-12-16 02:19:00
Message-ID: 5670CA14.7090208@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

VACUUM VERBOSE spits out two different messages for the heap, one of
which is rather confusing:

INFO: "trades": removed 625664 row versions in 20967 pages
...
INFO: "trades": found 3282 removable, 56891627 nonremovable row
versions in 1986034 out of 1986034 pages

After discussion with RhodiumToad I think I now understand how this can
happen:

20:00 < RhodiumToad> the LP_DEAD slot is where the index entries for the
deleted row point to, so that has to stay
20:01 < RhodiumToad> so for example, if you delete a lot of rows, then
try and do a lot of updates (which will hint the
pages as needing pruning),
20:01 < RhodiumToad> then do more updates or a seqscan (to let prune
look at the pages),
20:02 < RhodiumToad> then do a vacuum, the vacuum will see a lot of
LP_DEAD slots to remove index entries for, but not
actual tuples

This example is from a table that was VACUUM FULL'd this weekend and had
a nightly batch process run last night. That process INSERTs a bunch of
rows and then does a bunch of UPDATEs on different subsets of those
rows. I don't believe there would have been a large amount of deletes;
I'll check with them tomorrow.

IMHO we need to change the messages so they are explicit about line
pointers vs actual tuples. Trying to obfuscate that just leads to
confusion. heap_page_prune needs to report only non-rootlp tuples that
were pruned. (None of the other callers care about the return value.)
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2015-12-16 03:08:17 Re: 9.5RC1 wraps *today*
Previous Message Robert Haas 2015-12-16 02:01:27 Re: [PoC] Asynchronous execution again (which is not parallel)