pgsql-server/src/backend/commands analyze.c
pgsql-server/src/backend/commands analyze.c
От:
tgl@postgresql.org (Tom Lane)
Дата:
CVSROOT: /cvsroot Module name: pgsql-server Changes by: tgl@postgresql.org 02/08/10 20:08:48 Modified files: src/backend/commands: analyze.c Log message: Now that we allow ANALYZE to run inside a transaction block, the locks it takes could be held for quite awhile after the analyze step completes. Rethink locking of pg_statistic in light of this fact. The original scheme took an exclusive lock on pg_statistic, which was okay when the lock could be expected to be released shortly, but that doesn't hold anymore. Back off to a normal writer's lock (RowExclusiveLock). This allows concurrent ANALYZE of nonoverlapping sets of tables, at the price that concurrent ANALYZEs of the same table may fail with 'tuple concurrently updated'.