On 11/23/15 5:06 PM, Peter Geoghegan wrote:
I realize that the second scan performed by lazy_vacuum_heap() only visits those pages known to contain dead tuples. However, the experience of seeing problems with the random sampling of ANALYZE makes me think that that might not be very helpful. There is no good reason to think that there won't be a uniform distribution of dead tuples across the heap, and so only visiting pages known to contain dead tuples might be surprisingly little help even when there are relatively few VACUUM-able tuples in the table.
Even worse is if you can't fit all the dead TIDs in memory and have to do multiple passes for no reason...
Has any thought been given to how we could make VACUUM avoid a second heap scan iff there are only BRIN indexes, without compromising anything else? In other words, by killing heap TIDs*before* any "VACUUM" of BRIN index(es) occurs, avoiding a call to lazy_vacuum_heap(), just as when there are no indexes on the table whatsoever?
ISTM the big question here is how vacuum would know it can skip this since we wouldn't want to hard-code this for BRIN.
-- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers