Andreas Pflug <Andreas.Pflug@web.de> writes:
> I think a row counter on each table would be even useful for some kind
> of auto-vacuum mechanism, that could be triggered if pg_class.reltuples
> deviates too far from the real row count.
It would be counting the wrong thing. auto-vacuum needs to know how
many dead tuples are in a table, not how many live ones. Example:
UPDATE doesn't change the live-tuple count (without this property,
I don't think the sort of count maintenance Kevin is proposing could
possibly be efficient enough to be interesting). But it does create
a dead tuple that vacuum wants to know about.
regards, tom lane