Re: Thoughts about NUM_BUFFER_PARTITIONS

2024-09-27 Thread Nathan Bossart
On Mon, Aug 05, 2024 at 12:32:20AM +0500, Andrey M. Borodin wrote: > I´ve found some dead code: BufMappingPartitionLockByIndex() is unused, > and unused for a long time. See patch 1. I don't see a reason to also get rid of BufTableHashPartition(), but otherwise this looks reasonable to me. It wou

Re: Thoughts about NUM_BUFFER_PARTITIONS

2024-08-04 Thread Andrey M. Borodin
One of our customers recently asked me to look into buffer mapping. Following is my POV on the problem of optimal NUM_BUFFER_PARTITIONS. I’ve found some dead code: BufMappingPartitionLockByIndex() is unused, and unused for a long time. See patch 1. > On 23 Feb 2024, at 22:25, Tomas Vondra wrote

Re: Thoughts about NUM_BUFFER_PARTITIONS

2024-02-23 Thread Tomas Vondra
On 2/23/24 15:40, wenhui qiu wrote: > Hi Tomas Vondra > Thanks for the information! But I found postgres pro enterprise > version has been implemented ,However, it defaults to 16 and maxes out at > 128, and the maxes are the same as in PostgreSQL.I kindly hope that if the > developers can exp

Re: Thoughts about NUM_BUFFER_PARTITIONS

2024-02-23 Thread wenhui qiu
Hi Tomas Vondra Thanks for the information! But I found postgres pro enterprise version has been implemented ,However, it defaults to 16 and maxes out at 128, and the maxes are the same as in PostgreSQL.I kindly hope that if the developers can explain what the purpose of this is.May be 128 pa

Re: Thoughts about NUM_BUFFER_PARTITIONS

2024-02-20 Thread Tomas Vondra
Hi, On 2/20/24 03:16, wenhui qiu wrote: > Hi Heikki Linnakangas >I saw git log found this commit: > https://github.com/postgres/postgres/commit/3acc10c997f916f6a741d0b4876126b7b08e3892 > ,I don't seem to see an email discussing this commit. As the commit log > tells us, we don't know exactly h

Re: Thoughts about NUM_BUFFER_PARTITIONS

2024-02-19 Thread wenhui qiu
Hi Heikki Linnakangas I saw git log found this commit: https://github.com/postgres/postgres/commit/3acc10c997f916f6a741d0b4876126b7b08e3892 ,I don't seem to see an email discussing this commit. As the commit log tells us, we don't know exactly how large a value is optimal, and I believe it's mor

Re: Thoughts about NUM_BUFFER_PARTITIONS

2024-02-19 Thread wenhui qiu
Hi Japlin Li Thank you for such important information ! Got it Japin Li 于2024年2月19日周一 10:26写道: > > On Mon, 19 Feb 2024 at 00:56, Tomas Vondra > wrote: > > On 2/18/24 03:30, Li Japin wrote: > >> > >> I find it seems need to change MAX_SIMUL_LWLOCKS if we enlarge the > NUM_BUFFER_PARTITIONS, >

Re: Thoughts about NUM_BUFFER_PARTITIONS

2024-02-18 Thread Japin Li
On Mon, 19 Feb 2024 at 00:56, Tomas Vondra wrote: > On 2/18/24 03:30, Li Japin wrote: >> >> I find it seems need to change MAX_SIMUL_LWLOCKS if we enlarge the >> NUM_BUFFER_PARTITIONS, >> I didn’t find any comments to describe the relation between >> MAX_SIMUL_LWLOCKS and >> NUM_BUFFER_PARTIT

Re: Thoughts about NUM_BUFFER_PARTITIONS

2024-02-18 Thread Tomas Vondra
On 2/18/24 03:30, Li Japin wrote: > > >> On Feb 10, 2024, at 20:15, Tomas Vondra >> wrote: >> >> On 2/8/24 14:27, wenhui qiu wrote: >>> Hi Heikki Linnakangas >>>I think the larger shared buffer higher the probability of multiple >>> backend processes accessing the same bucket slot BufMappi

Re: Thoughts about NUM_BUFFER_PARTITIONS

2024-02-17 Thread Li Japin
> On Feb 10, 2024, at 20:15, Tomas Vondra wrote: > > On 2/8/24 14:27, wenhui qiu wrote: >> Hi Heikki Linnakangas >>I think the larger shared buffer higher the probability of multiple >> backend processes accessing the same bucket slot BufMappingLock >> simultaneously, ( InitBufTable(NBuf

Re: Thoughts about NUM_BUFFER_PARTITIONS

2024-02-10 Thread Tomas Vondra
On 2/8/24 14:27, wenhui qiu wrote: > Hi Heikki Linnakangas > I think the larger shared buffer higher the probability of multiple > backend processes accessing the same bucket slot BufMappingLock > simultaneously, ( InitBufTable(NBuffers + NUM_BUFFER_PARTITIONS); When I > have free time, I wa

Re: Thoughts about NUM_BUFFER_PARTITIONS

2024-02-08 Thread wenhui qiu
Hi Heikki Linnakangas I think the larger shared buffer higher the probability of multiple backend processes accessing the same bucket slot BufMappingLock simultaneously, ( InitBufTable(NBuffers + NUM_BUFFER_PARTITIONS); When I have free time, I want to do this test. I have seen some tests, b

Re: Thoughts about NUM_BUFFER_PARTITIONS

2024-02-08 Thread Heikki Linnakangas
On 08/02/2024 12:17, wenhui qiu wrote: HI hackers     When I read this text in this document there is a paragraph in it(https://www.interdb.jp/pg/pgsql08/03.html ) /* The BufMappingLock is split into partitions to reduce contention in the buffer tab

Thoughts about NUM_BUFFER_PARTITIONS

2024-02-08 Thread wenhui qiu
HI hackers When I read this text in this document there is a paragraph in it( https://www.interdb.jp/pg/pgsql08/03.html) /* The BufMappingLock is split into partitions to reduce contention in the buffer table (the default is 128 partitions). Each BufMappingLock partition guards a portion of the