Re: ANALYZE locks pg_listener in EXCLUSIVE for long time? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ANALYZE locks pg_listener in EXCLUSIVE for long time?
Date
Msg-id 13680.1083598206@sss.pgh.pa.us
Whole thread Raw
In response to Re: ANALYZE locks pg_listener in EXCLUSIVE for long time?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: ANALYZE locks pg_listener in EXCLUSIVE for long  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
I wrote:
> 2. As the ANALYZE proceeds, it issues sinval messages due to the updates
> it's making in pg_statistic.  This is normal.

Small correction: actually, backends only send sinval messages at
commit, so the ANALYZE will just be accumulating pending messages in its
private memory.  Your observed symptom therefore can only occur if other
transactions running parallel to the ANALYZE perform sufficient catalog
updating activity to fill the sinval message queue.  And there must also
be at least one long-term-idle backend, so that the queue doesn't get
drained.

I had been wondering why we'd not identified this problem before, but
that combination of factors is probably unusual enough to explain why
not.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ANALYZE locks pg_listener in EXCLUSIVE for long time?
Next
From: Paul Ramsey
Date:
Subject: Re: PostgreSQL pre-fork speedup