Hannu Krosing <hannu@tm.ee> writes:
> A more general solution to the problem "VACUUM does not clean dead
> tuples fast enough due to an old transaction" problem is keeping the
> OldestXmin for each table separately as a list of table OIDs in each
> PGPROC.
> This would be automatically extandable to long COPY, or in fact any
> single SQL statement running in its implicit transaction by examining
> the query plan and reserving all tables touched by the query and its
> dependencies.
This is completely unworkable, since it amounts to assuming you know at
the start of a serializable transaction which tables it will touch. In
point of fact you can't even know that for the current query let alone
future ones --- consider user-defined functions.
(Not to mention that we can't expect to fit that much info into a fixed
amount of shared memory.)
regards, tom lane