> On 11 Jan 2016, at 21:43, Simon Riggs <simon@2ndquadrant.com> wrote: > > Have you measured lwlocking as a problem? >
Yes. GXACT locks that wasn’t even in perf top 10 on dual Xeon moves to the first places when running on 60 core system. But Jesper’s flame graph on 24 core system shows different picture.
I think we can use a shmem hash table to identify the GID by name during LockGxact and avoid duplicates during prepare. Hashing on the first 16 bytes of the GID should be sufficient in most cases; the worst case would be the same as it is now, all depending on how people use the GID name field. The hash value can be calculated outside of the lock. We can also partition the lock without risk, just adds a little extra code.
We can also optimize final removal (sketch of how to do that attached).
--
Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services