Re: a lot of session wait on lock relation

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: James Pang <jamespang886(at)gmail(dot)com>, pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: a lot of session wait on lock relation
Date: 2025-05-15 12:08:05
Message-ID: 54994813530a36c0280fd8779e65ad1ad73d910a.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, 2025-05-15 at 16:27 +0800, James Pang wrote:
> PGv 15.10,  many session coming in doing "insert into tablexxx values...." in parallel,
> this is a range partition tables, total 12 partitions plus one default partition,
> only three btree indexes, no others constraints ,no foreign key. but we see hundreds
> of session waiting on "lock:relation", why inserts into partition table cause "relation lock" ?

Something else does; use the pg_blocking_pids() function with the process ID of
a blocked backend to find out who is holding the lock.

If you have hundreds of sessions, you are allowing to many connections.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2025-05-15 13:24:30 Re: a lot of session wait on lock relation
Previous Message Chetan 2025-05-15 09:31:12 Re: a lot of session wait on lock relation