4 ms·
A normal vacuum will also defragment page contents, see PageRepairFragmentation()[1], which is called during normal vacuum from lazy_vacuum_page(). [1] https:/
by ants_a 5y ago
A normal vacuum will also defragment page contents, see PageRepairFragmentation()[1], which is called during normal vacuum from lazy_vacuum_page().
[1] https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/storage/page/bufpage.c;h=147ba4d92320f97cbc2071c189ccd6cd168cb2f9;hb=HEAD#l684 https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f...
- pgaddict 5y agoYeah, VACUUM only shuffles rows within a page, to maximize the amount of free space available for new data. VACUUM FULL essentially rebuilds the segment files - it creates new files and shovels all rows from the old ones. In the past it was implemented differently, by actually moving rows (a bit like defrag tools in Windows) but that was very expensive and inefficient.