Re: [WIP] Add relminxid column to pg_class - Mailing list pgsql-patches

From Tom Lane
Subject Re: [WIP] Add relminxid column to pg_class
Date
Msg-id 25748.1144019816@sss.pgh.pa.us
Whole thread Raw
In response to [WIP] Add relminxid column to pg_class  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: [WIP] Add relminxid column to pg_class  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: [WIP] Add relminxid column to pg_class  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-patches
Alvaro Herrera <alvherre@commandprompt.com> writes:
> I just noticed a problem, which is why I labeled it a WIP: the current
> implementation turns pg_database.datminxid to InvalidTransactionId when
> the table that has the minimum relminxid is dropped.  The problem is
> that this could cause "vacuum starvation" if autovacuum is using
> datminxid to decide what database to vacuum, and the minimum Xid table
> is being dropped continuously.  I had refrained from calculating
> pg_database.datminxid each time said table is dropped, because doing it
> means scanning pg_class and locking pg_database -- I'm wary of deadlock
> problems.  Not sure what to do here.  (Maybe the answer is to do nothing
> -- this is a very low probability scenario anyway.  Opinions?)

I'd argue that you should do nothing, ie, dropping a table should never
affect datminxid.  The proper interpretation of the pg_database columns
is that we guarantee that all XID's in the database are *at least* thus-
and-so, not that the minimum is exact.

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: psql patch: new host/port without leaving session
Next
From: Alvaro Herrera
Date:
Subject: Re: [WIP] Add relminxid column to pg_class