pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Jeff Davis <pgsql@j-davis.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: vignesh C <vignesh21@gmail.com>
Cc: Peter Smith <smithpb2250@gmail.com>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
Cc: Shubham Khanna <khannashubham1197@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Improve eviction algorithm in ReorderBuffer
Date: Tue, 09 Apr 2024 18:24:43 -0700
Message-ID: <10f5dcecb5224c9967a7d595b6168a4144ffc24e.camel@j-davis.com> (raw )
In-Reply-To: <8cb6bbf6-57e7-4d14-9664-89505993afaa@iki.fi >
References: <CAD21AoAfKTgrBrLq96GcTv9d6k97zaQcDM-rxfKEt4GSe0qnaQ@mail.gmail.com >
<CALDaNm14V8KHrxvqoOXd786Dkae-DFR4TDq1sj18SXCYUdDGzw@mail.gmail.com >
<CAD21AoDomWEkepxa8uE6s2eSoiB+gjtt51zx3Cnz6oLV_51U2Q@mail.gmail.com >
<CAA4eK1JTbEX-PcGwSni=W3J=viq4-BeRp1cmQAscJw0xxMAskQ@mail.gmail.com >
<CAD21AoA6=+tL=btB_s9N+cZK7tKz1W=PQyNq72nzjUcdyE+wZw@mail.gmail.com >
<CAD21AoC51TL6k+PFXyWEie-MVo7dqCHmPzTqfUaUueyx9OfLyw@mail.gmail.com >
<12747c15811d94efcc5cda72d6b35c80d7bf3443.camel@j-davis.com >
<fa89b6963899a05931f905dc7b1597e55b8204f5.camel@j-davis.com >
<CAD21AoAd7ZUz1SVKc+WNqNcTJdBZOBUeV_iExyzqk8WLyoNy1A@mail.gmail.com >
<f13d88915e7e197ccb78968a825d1c021f62c8ce.camel@j-davis.com >
<CAD21AoCfP++VF+12Za7SV_vQpRpFbe+Kf_LQsRPAw_pJj0YS3Q@mail.gmail.com >
<cecac19e0fb5739d4fd955000d19d88d060924d4.camel@j-davis.com >
<CAD21AoAtR2A4f1-JFUE9KRkiPqMRvxS+3W=ZR7FpuXm8VSVASQ@mail.gmail.com >
<791d98f474e518387d09eb390b8a12f265d130cc.camel@j-davis.com >
<8cb6bbf6-57e7-4d14-9664-89505993afaa@iki.fi >
On Tue, 2024-04-09 at 23:49 +0300, Heikki Linnakangas wrote:
>
> I wonder why this doesn't use the existing pairing heap
> implementation? I would assume that to be at least as good as the
> binary
> heap + hash table
I agree that an additional hash table is not needed -- there's already
a hash table to do a lookup based on xid in reorderbuffer.c.
I had suggested that the heap could track the element indexes for
efficient update/removal, but that would be a change to the
binaryheap.h API, which would require some discussion (and possibly not
be acceptable post-freeze).
But I think you're right: a pairing heap already solves the problem
without modification. (Note: our pairing heap API doesn't explicitly
support updating a key, so I think it would need to be done with
remove/add.) So we might as well just do that right now rather than
trying to fix the way the hash table is being used or trying to extend
the binaryheap API.
Of course, we should measure to be sure there aren't bad cases around
updating/removing a key, but I don't see a fundamental reason that it
should be worse.
Regards,
Jeff Davis
view thread (93+ messages) latest in thread
Message-ID: <10f5dcecb5224c9967a7d595b6168a4144ffc24e.camel@j-davis.com>
Permalink: ../10f5dcecb5224c9967a7d595b6168a4144ffc24e.camel@j-davis.com/
Also on: postgresql.org/message-id/10f5dcecb5224c9967a7d595b6168a4144ffc24e.camel@j-davis.com
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: pgsql@j-davis.com, hlinnaka@iki.fi, sawada.mshk@gmail.com, amit.kapila16@gmail.com, vignesh21@gmail.com, smithpb2250@gmail.com, tomas.vondra@enterprisedb.com, kuroda.hayato@fujitsu.com, khannashubham1197@gmail.com, dilipbalaut@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Improve eviction algorithm in ReorderBuffer
In-Reply-To: <10f5dcecb5224c9967a7d595b6168a4144ffc24e.camel@j-davis.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox