Tom Lane <tgl@sss.pgh.pa.us> writes:
> AFAICS, central-counter techniques could only work in an MVCC system
> if each transaction copies every counter in the system at each snapshot
> freeze point, in case it finds itself needing that counter value later
> on. This is a huge amount of mostly-useless overhead, and it makes the
> problem of lock contention for access to the counters several orders of
> magnitude worse than you'd first think.
Well, one option would be to do it in a lazy way. If you do an update on a
table with cached aggregate data just throw the data out. This way you get to
cache data on infrequently updated tables and get only a very small penalty on
frequently updated tables.
--
greg