Re: Analyse - max_locks_per_transaction - why?

From: Phil Endecott <spam_from_postgresql_general(at)chezphil(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Analyse - max_locks_per_transaction - why?
Date: 2004-11-11 16:50:56
Message-ID: 41939870.3060507@chezphil.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I asked:

>>Naively I imagined that ANALYSE looks at each table in turn,
>>independently. So why does it need more locks when there are more
>>tables?

Tom replied:

> 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.

Thanks Tom. I will upgrade to 8.0 one day but not soon. In the
meantime, is there a way to judge a suficient setting for
max_locks_per_transaction so that a global ANALYZE will work? It
doesn't seem to be one lock per table or anything as simple as that.

> 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.

That's another possibility.

Thanks.

--Phil.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gary L. Burnore 2004-11-11 17:33:57 Re: Important Info on
Previous Message Tom Lane 2004-11-11 15:59:45 Re: Can't insert date in field with foreign key