LwLockRelease performance

From: Ashkil Dighin <ashkildighin76(at)gmail(dot)com>
To: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: LwLockRelease performance
Date: 2021-12-01 14:26:11
Message-ID: CAH6zzqCqZGqwDBWQqHb=XSVMyRBHBE+bh5sVnrQe-UE0uabwtg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi
The performance bottleneck in LWLockRelease()method goes through an array
one by one to see which lock was released with O(N). As soon as the lock is
found it performs an array to remove the lock.
As linear search and compaction delays the release of the lock forcing the
other Postgres instances WAiting for the lock to be released
Is any possible solution like
1. LWLockRelease() releases the lock first and then remove held lock from
the array
2. Binary search (like non-linear structure) to reduce on high searching
and remove all held locks

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2021-12-02 22:19:39 Re: LwLockRelease performance
Previous Message pgsql-performance 2021-11-30 21:38:32 pg_trgm word_similarity query does not use index for input strings longer than 8 characters