Re: slru bank

2024-08-22 Thread David G. Johnston
On Thu, Aug 22, 2024 at 7:27 PM Tom Lane wrote: > "David G. Johnston" writes: > > On Thu, Aug 22, 2024 at 7:07 PM 席冲(宜穆) > wrote: > >> In SlruSelectLRUPage(), Why do we need to traverse all slots to find > that > >> a page already has a buffer assigned? Why not find it > >> from the [bankstart

Re: slru bank

2024-08-22 Thread Tom Lane
"David G. Johnston" writes: > On Thu, Aug 22, 2024 at 7:07 PM 席冲(宜穆) wrote: >> In SlruSelectLRUPage(), Why do we need to traverse all slots to find that >> a page already has a buffer assigned? Why not find it >> from the [bankstart,bankend]? > Only the bank is searched, both of the logic loops

Re: slru bank

2024-08-22 Thread David G. Johnston
On Thu, Aug 22, 2024 at 7:07 PM 席冲(宜穆) wrote: > In SlruSelectLRUPage(), Why do we need to traverse all slots to find that > a page already has a buffer assigned? Why not find it > from the [bankstart,bankend]? > > Only the bank is searched, both of the logic loops are bounded by: for (int slotn

slru bank

2024-08-22 Thread 席冲(宜穆)
Hello all, This PostgreSQL version is 17beta2. In SlruSelectLRUPage(), Why do we need to traverse all slots to find that a page already has a buffer assigned? Why not find it from the [bankstart,bankend]? Best regards