Re: VACUUM touching file but not updating relation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thom Brown <thom(at)linux(dot)com>
Cc: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: VACUUM touching file but not updating relation
Date: 2011-11-11 00:55:34
Message-ID: 21187.1320972934@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Thom Brown <thom(at)linux(dot)com> writes:
> On 14 October 2011 12:12, Thom Brown <thom(at)linux(dot)com> wrote:
>> I just noticed that the VACUUM process touches a lot of relations
>> (affects mtime) but for one file I looked at, it didn't change. This
>> doesn't always happen, and many relations aren't touched at all.

No immmediate ideas as to why the mtime would change if the file
contents didn't. It seems like there must be a code path that marked
a buffer dirty without having changed it, but we're usually pretty
careful about that.

>> And I can't find out what this particular OID relates to
>> either.

Well, the generic method is

regression=# select oid,relname from pg_class where relfilenode = 11946;
oid | relname
-------+----------------
11563 | pg_toast_11561
(1 row)

This is a toast relation, so ...

regression=# select oid,relname from pg_class where reltoastrelid = 11563;
oid | relname
-------+--------------
11561 | sql_packages
(1 row)

So in my git-tip database, that relfilenode is
information_schema.sql_packages' TOAST table. However, such OID
assignments aren't terribly stable in development tip, and it was almost
certainly something different a month ago (especially since
sql_packages' TOAST table is generally empty, and your file is not).
So you'll need to check this for yourself to see what it was, assuming
you still have that database around. It's a safe bet that it was a
system catalog or index or toast table belonging thereto, though, just
based on the range of OIDs it's in.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2011-11-11 01:18:41 Re: VACUUM touching file but not updating relation
Previous Message Bborie Park 2011-11-11 00:47:21 Re: Passing NULL to a function called with OidFunctionCall3

Browse pgsql-hackers by date

  From Date Subject
Next Message Thom Brown 2011-11-11 01:18:41 Re: VACUUM touching file but not updating relation
Previous Message Thom Brown 2011-11-11 00:28:06 Re: [COMMITTERS] pgsql: Enable CHECK constraints to be declared NOT VALID