1

Assuming large delete and updates are done on a GP table.

Shouldn't i run vacuum analyze together? Should i run vacuum and analyze separately?. The GP best practice document says "Do not run vacuum analyze" http://gpdb.docs.pivotal.io/4300/pdf/GPDB43BestPractices.pdf

What is the order it runs when i run vacuum analyze? Is there any best practice around the order to run vacuum and analyze? Why Pivotal says do not run both of them together?

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

1

It's safer to run ANALYZE before running VACUUM to correct any potential inaccurate row count estimate when a table is significantly bloated.

Because ANALYZE uses block-level sampling, a table with a high ratio of blocks containing no valid rows can cause ANALYZE to set the reltuples column in pg_class catalog table to an inaccurate value, leading to unoptimized query plans. The VACUUM command produces a more accurate count and when run after ANALYZE will correct an inaccurate row count estimate.

ielizaga
  • 11
  • 3