Tom Lane wrote:
>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.
>
>
>
I understand your point, but is this about VACUUM only or VACUUM ANALYZE
too? People wouldn't bother about big databases if it's still fast
(until the disk is full :-)
Do dead tuples affect query planning? I thought the plan only cares
about existing rows and their data patterns.
So count(*), pg_stat_all_tables.n_tup_ins, .n_tup_upd and .n_tup_del all
together can make a VACUUM ANALYZE necessary, right?
Regards,
Andreas