Re: Speedup twophase transactions - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Speedup twophase transactions
Date
Msg-id CANP8+jJpOFNwavqtU+r89VPfdehAVYos0gJY=0M2eFwjjus-3g@mail.gmail.com
Whole thread Raw
In response to Re: Speedup twophase transactions  (Stas Kelvich <s.kelvich@postgrespro.ru>)
List pgsql-hackers
On 11 January 2016 at 23:11, Stas Kelvich <s.kelvich@postgrespro.ru> wrote:
 
>
> 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
Attachment

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Speedup twophase transactions
Next
From: Michael Paquier
Date:
Subject: Re: PATCH: add pg_current_xlog_flush_location function