Re: a lot of session wait on lock relation

2025-05-15 Thread James Pang
Thanks, we are checking the partition maintain job , we have 12 partitions , each week one partition there is a default partition attached with this table and huge rows in default partition too , default partition has primary key that include partition key (time range based) too. partition job det

Re: a lot of session wait on lock relation

2025-05-15 Thread James Pang
thanks, we are checking partition maintain jobs ,that hold access exclusive lock. Tom Lane 於 2025年5月15日週四 下午9:24寫道: > Laurenz Albe writes: > > On Thu, 2025-05-15 at 16:27 +0800, James Pang wrote: > >> why inserts into partition table cause "relation lock" ? > > > Something else does; use the

Re: a lot of session wait on lock relation

2025-05-15 Thread Tom Lane
Laurenz Albe writes: > On Thu, 2025-05-15 at 16:27 +0800, James Pang wrote: >> 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. More specifically:

Re: a lot of session wait on lock relation

2025-05-15 Thread Laurenz Albe
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.

Re: a lot of session wait on lock relation

2025-05-15 Thread Chetan
Hi James, Could share the related test setup details? Would like to look into this. Thanks, Chetan On Thu, 15 May 2025 at 09:27, James Pang wrote: > Hi, >PGv 15.10, many session coming in doing "insert into tablexxx > values" in parallel, this is a range partition tables, total 12 >

a lot of session wait on lock relation

2025-05-15 Thread James Pang
Hi, 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"