HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Is vacuuming a PostgreSQL materialized view necessary?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
postgresqlvacuumingnecessarymaterializedview

Problem

I understand it makes sense to analyze a Materialized View (MV), but since MVs are not updateable, does that imply that we need not ever vacuum a MV?

Solution

Materialized views need to be vacuumed:

-
At some point, old rows need to be “frozen” to prevent data loss when the transaction ID counter wraps around.

-
If you use REFRESH MATERIALIZED VIEW CONCURRENTLY, dead tuples are created and need to be removed by VACUUM.

Context

StackExchange Database Administrators Q#294302, answer score: 6

Revisions (0)

No revisions yet.