Re: Simplify VM counters in vacuum code

2025-06-26 Thread Melanie Plageman
On Thu, Jun 26, 2025 at 10:25 AM Masahiko Sawada wrote: > > Thank you for updating the patch! The changes in v3 appear > straightforward; the patch eliminates unnecessary codes that were > introduced in the original commit due to some misunderstandings. And I > agreed with your answer[1] to my que

Re: Simplify VM counters in vacuum code

2025-06-26 Thread Masahiko Sawada
On Thu, Jun 26, 2025 at 10:01 PM Melanie Plageman wrote: > > On Wed, Jun 25, 2025 at 2:59 AM Nazir Bilal Yavuz wrote: > > > > I liked this version more. I agree that the asserts were causing some > > confusion. > > Thanks for the review! > > Sawada-san, do you have any objection to this being me

Re: Simplify VM counters in vacuum code

2025-06-26 Thread Melanie Plageman
On Wed, Jun 25, 2025 at 2:59 AM Nazir Bilal Yavuz wrote: > > I liked this version more. I agree that the asserts were causing some > confusion. Thanks for the review! Sawada-san, do you have any objection to this being merged in master/18? I know you had said changing the if statements to asser

Re: Simplify VM counters in vacuum code

2025-06-25 Thread Melanie Plageman
On Tue, Jun 24, 2025 at 4:01 AM Nazir Bilal Yavuz wrote: > > > Thank you for the patch! I could not understand the following change: > > > > + /* We know the page should not have been all-visible */ > > + Assert((old_vmbits & VISIBILITYMAP_VALID_BITS) == 0); > > + (void) old_vmbi

Re: Simplify VM counters in vacuum code

2025-06-25 Thread Nazir Bilal Yavuz
Hi, On Tue, 24 Jun 2025 at 07:13, Masahiko Sawada wrote: > Thank you for working on this! > On Tue, Jun 24, 2025 at 4:21 AM Melanie Plageman > wrote: > > > > Hi, > > > > In dc6acfd910b8, I added some counters to track and log in > > autovacuum/vacuum output the number of pages newly set > > al

Re: Simplify VM counters in vacuum code

2025-06-24 Thread Nazir Bilal Yavuz
Hi, On Tue, 24 Jun 2025 at 18:12, Melanie Plageman wrote: > > On Tue, Jun 24, 2025 at 9:17 AM Melanie Plageman > wrote: > > > > On Tue, Jun 24, 2025 at 4:01 AM Nazir Bilal Yavuz > > wrote: > > > > > I think we do not need to check visibility of the page here, as we > > > already know that page

Re: Simplify VM counters in vacuum code

2025-06-24 Thread Melanie Plageman
Thanks for the review! On Tue, Jun 24, 2025 at 12:12 AM Masahiko Sawada wrote: > > On Tue, Jun 24, 2025 at 4:21 AM Melanie Plageman > wrote: > > The flags is initialized as: > > uint8 flags = VISIBILITYMAP_ALL_VISIBLE; > > so the new if-condition is always true. Yep, this was a mi

Re: Simplify VM counters in vacuum code

2025-06-24 Thread Melanie Plageman
On Tue, Jun 24, 2025 at 9:17 AM Melanie Plageman wrote: > > On Tue, Jun 24, 2025 at 4:01 AM Nazir Bilal Yavuz wrote: > > > I think we do not need to check visibility of the page here, as we > > already know that page was not all-visible due to LP_DEAD items. We > > can simply increment the vacrel

Re: Simplify VM counters in vacuum code

2025-06-23 Thread Masahiko Sawada
On Tue, Jun 24, 2025 at 4:21 AM Melanie Plageman wrote: > > Hi, > > In dc6acfd910b8, I added some counters to track and log in > autovacuum/vacuum output the number of pages newly set > all-visible/frozen. Taking another look at the code recently, I > realized the conditions for setting the counte

Simplify VM counters in vacuum code

2025-06-23 Thread Melanie Plageman
Hi, In dc6acfd910b8, I added some counters to track and log in autovacuum/vacuum output the number of pages newly set all-visible/frozen. Taking another look at the code recently, I realized the conditions for setting the counters could be simplified because of what we know to be true about the st