Visibility Map • Introduced at 8.4 • A bit map for each table (1 bit per 1 page) • A table relation can have a visibility map. • keep track of which pages are al -visible page • keep track of which pages are having garbage. • If 500GB table, Visibility Map is less than 10MB. Table (base/XXX/1234) Visibility Map Block 0 (base/XXX/1234_vm)
How does the VACUUM works actual y? • VACUUM works with two phases; 1. Scan table to col ect TID 2. Reclaim garbage (Table, Index) 1st Phase maintenance_work_mem Col ect garbage TID 2nd Phase Table Reclaim garbages Scan Table Index
Anti-wraparound VACUUM If you e dxe o cu V te AC V U AC U U M aU t M thi a s t th XI is D, XID, VACUUM could anti- aa nn titi-w -w ra rapp aaro rouu nn dd V V AC AC U U U U M M i w s il be do a whole wraparound executed. executed. table scan VACUUM is launched forcibly anti-wraparound VACUUM pg_class.
Anti-wraparound VACUUM After current XID is exceeded, anti- anti- VACUUM could wraparound VACUUM is launched wraparound do a whole forcibly by autovacuum. VACUUM is table scan launched forcib aly n ti-wraparound auto VACUUM