VACUUM ANALYZE -vs- ANALYZE on an insert-only table.

From: "Matt Gordon" <m(dot)gordon(at)f5(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: VACUUM ANALYZE -vs- ANALYZE on an insert-only table.
Date: 2003-12-11 23:26:56
Message-ID: 47BC08C8E02BA54EBD901AB9328BFBC08BFCD4@exchtwo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

If I have a table that I only use for INSERTs and queries (no UPDATEs or DELETEs), is it enough to just run ANALYZE on the table instead of VACUUM ANALYZE? In other words, is running a VACUUM on a table useful if all that you're doing is INSERTing into it? My understanding of VACUUM is that it cleans up stale tuples that are left after UPDATEs and DELETEs.

The reason that I'm asking this has mainly to do with performance. I've got a lot of large tables (> 1 million records) in my database. Running a nightly VACUUM ANALYZE takes a while (> 1 hour) to run. I'm wondering, given the condition above, if I can skip the VACUUM part for these large tables and just run ANALYZE.

If it matters, we're currently using Postgres 7.2.1.

-Matt.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kris Jurka 2003-12-11 23:36:35 Re: cancel query
Previous Message Rick Gigger 2003-12-11 22:54:10 Re: [NOVICE] PostgreSQL Training