- Notifications
You must be signed in to change notification settings - Fork5
Commitda7540b
committed
Change ANALYZE to take ShareUpdateExclusiveLock not AccessShareLock on
the table being analyzed. This prevents two ANALYZEs from runningconcurrently on the same table and possibly suffering concurrent-updatefailures while trying to store their results into pg_statistic. Thedownside is that a database-wide ANALYZE executed within a transactionblock will hold ShareUpdateExclusiveLock on many tables simultaneously,which could lead to concurrency issues or even deadlock against anothersuch ANALYZE. However, this seems a corner case of less importancethan getting unexpected errors from a foreground ANALYZE when autovacuumelects to analyze the same table concurrently. Per discussion.1 parent2e5e856 commitda7540b