Re: LWLock granular partition lock memory layout - Mailing list pgsql-hackers

From Alexandre Felipe
Subject Re: LWLock granular partition lock memory layout
Date
Msg-id CAE8JnxO699xhiRx=QjBdO3V8wYz32yTkFdhq0aiqa4iXTXwV6w@mail.gmail.com
Whole thread
In response to Re: LWLock granular partition lock memory layout  (Alexandre Felipe <o.alexandre.felipe@gmail.com>)
List pgsql-hackers
> I argue that having S partitions is better in several different ways.
>
> a. Concurrency of LW_EXCLUSIVE
> b. Reduced contention on LWLockWaitListLock
> c. Reduced CAS iterations in LWLockAtttemptLock
> d. Reduced waits (that implies wait list access and sleeping)

In theory this has benefits with no compromises.

In practice, it is more impactful than I initially expected.

I thought it would be noticeable only in large scale systems, but even on my
lightweight laptop with 8 cores the results are measurable.

With 128 partitions

clients         base      patched

      1      26371.6      26149.2

      8      35659.7      44958.5        +26.1%



Regards,

Alexandre

Attachment

pgsql-hackers by date:

Previous
From: best xmg
Date:
Subject: Re: Hash a ScalarArrayOpExpr whose array is fixed for one execution
Next
From: Peter Geoghegan
Date:
Subject: Re: index prefetching