Re: Analyse - max_locks_per_transaction - why? - Mailing list pgsql-general

From Tom Lane
Subject Re: Analyse - max_locks_per_transaction - why?
Date
Msg-id 14022.1100108789@sss.pgh.pa.us
Whole thread Raw
In response to Analyse - max_locks_per_transaction - why?  (Phil Endecott <spam_from_postgresql_general@chezphil.org>)
Responses Re: Analyse - max_locks_per_transaction - why?
List pgsql-general
Phil Endecott <spam_from_postgresql_general@chezphil.org> writes:
> Naively I imagined that ANALYSE looks at each table in turn,
> independently.  So why does it need more locks when there are more
> tables?

7.4 runs a database-wide ANALYZE as a single transaction, so the locks
accumulate.  This was recognized to be a bad idea :-(.  8.0 is a bit
smarter.

The best bet in 7.4 is probably to use VACUUM ANALYZE rather than
analyzing separately.  That will force it to use a transaction per
table.

            regards, tom lane

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Modifying FK constraints
Next
From: "Goutam Paruchuri"
Date:
Subject: Re: Error connecting using pgadmin from different computer