Re: Improve eviction algorithm in ReorderBuffer - Mailing list pgsql-hackers

From vignesh C
Subject Re: Improve eviction algorithm in ReorderBuffer
Date
Msg-id CALDaNm14V8KHrxvqoOXd786Dkae-DFR4TDq1sj18SXCYUdDGzw@mail.gmail.com
Whole thread Raw
In response to Re: Improve eviction algorithm in ReorderBuffer  (Masahiko Sawada <sawada.mshk@gmail.com>)
Responses Re: Improve eviction algorithm in ReorderBuffer
List pgsql-hackers
On Tue, 26 Mar 2024 at 10:05, Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> On Thu, Mar 14, 2024 at 12:02 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> >
> >
> > I've attached new version patches.
>
> Since the previous patch conflicts with the current HEAD, I've
> attached the rebased patches.

Thanks for the updated patch.
One comment:
I felt we can mention the improvement where we update memory
accounting info at transaction level instead of per change level which
is done in ReorderBufferCleanupTXN, ReorderBufferTruncateTXN, and
ReorderBufferSerializeTXN also in the commit message:
@@ -1527,7 +1573,7 @@ ReorderBufferCleanupTXN(ReorderBuffer *rb,
ReorderBufferTXN *txn)
                /* Check we're not mixing changes from different
transactions. */
                Assert(change->txn == txn);

-               ReorderBufferReturnChange(rb, change, true);
+               ReorderBufferReturnChange(rb, change, false);
        }

        /*
@@ -1586,8 +1632,13 @@ ReorderBufferCleanupTXN(ReorderBuffer *rb,
ReorderBufferTXN *txn)
        if (rbtxn_is_serialized(txn))
                ReorderBufferRestoreCleanup(rb, txn);

+       /* Update the memory counter */
+       ReorderBufferChangeMemoryUpdate(rb, NULL, txn, false, txn->size);

Regards,
Vignesh



pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: Combine Prune and Freeze records emitted by vacuum
Next
From: Masahiko Sawada
Date:
Subject: Re: [PoC] Improve dead tuple storage for lazy vacuum