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