About 99% articles i read states that VACUUM FULL is a bad practise and can even results into slower DB.
More recommended way articles states is to VACUUM ANALYZE and REINDEX afterwards.
For sure, let's consider for a while that AUTOVACUUM is not enough for some reason, for example - optimal settings are not tuned up at the moment.
What i found is that during our performance tests on regular basis - VACUUM FULL cause better throughput due to much lower and at the same time with better latency - disk IO.
My theory is that VACUUM FULL cause OS to perform more sequental reads rather than random reads. Also, maybe, it allows Page cache to be more saturated due to lower tables size.
Can someone please point me the right way where and what can i do to investigate the real cause of VACUUM FULL ANALYZE performance gain comparing to VACUUM ANALYZE + REINDEX ?
Thanks in advance !
PG 14 in production.
UPDATE
Found an answer:
https://severalnines.com/blog/tuning-io-operations-postgresql/
section "VACUUM FULL".
The reason is disk io of course, but mainly - such operations like seq scan traverse dead tuples too. Maybe it should check if the tuple is dead or the space was reused for new records, btw, if you read the article - the query time (synthetic, doesn't include indexes) dropped from 1.9s to 1.4s after VACUUM FULL ANALYZE comparing to VACUUM ANALYZE.