Sorry for report late. Our lab's machines crashed for several days. 

As I reported in the last email,
I tried to decrease the contention on SerializableFinishedListLock. 
It works actually.  But I don't know why my optimization results in another 
problems: more contention on PREDICATELOCK_MANAGER_LWLOCK.

Here is the result of statistics collector. There were 36 connections in all, 
so most of them are waiting for locks. 
 (benchmark is ssibench, but other benchmarks have the same result) 

        SerializableXactHashLock, 0.36
        predicate_lock_manager, 6.00
        wal_insert, 0.07
        SerializableFinishedListLock, 16.50

After optimization: 
        SerializableXactHashLock, 0.35
        predicate_lock_manager, 11.53
        buffer_content, 0.12
        SerializableFinishedListLock, 11.47

So in the end, the performance did not change obviously. 
Even if I enlarged the number of predicate locks (NUM_PREDICATELOCK_PARTITIONS) 
from 16 to 1024, 
there were still so many contentions. 

It bothered me for several days. The patch is attached. 
To focus on this issue, I removed other parts of modification. 
Do you have any advices for this ? 



Mengxing Liu

Attachment: finishedlock.patch
Description: Binary data

Sent via pgsql-hackers mailing list (
To make changes to your subscription:

Reply via email to