Re: Improve eviction algorithm in ReorderBuffer
От
Jeff Davis
Тема
Re: Improve eviction algorithm in ReorderBuffer
Дата
Msg-id
12747c15811d94efcc5cda72d6b35c80d7bf3443.camel@j-davis.com
Ответ на
Re: Improve eviction algorithm in ReorderBuffer (Masahiko Sawada)
Список
Дерево обсуждения
Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer "Euler Taveira" <euler@eulerto.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Dilip Kumar <dilipbalaut@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Amit Kapila <amit.kapila16@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Amit Kapila <amit.kapila16@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Amit Kapila <amit.kapila16@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Amit Kapila <amit.kapila16@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer vignesh C <vignesh21@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
RE: Improve eviction algorithm in ReorderBuffer "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
RE: Improve eviction algorithm in ReorderBuffer "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: Improve eviction algorithm in ReorderBuffer Shubham Khanna <khannashubham1197@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Ajin Cherian <itsajin@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Ajin Cherian <itsajin@gmail.com>
RE: Improve eviction algorithm in ReorderBuffer "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer vignesh C <vignesh21@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Tomas Vondra <tomas.vondra@enterprisedb.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Tomas Vondra <tomas.vondra@enterprisedb.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Amit Kapila <amit.kapila16@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer vignesh C <vignesh21@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Peter Smith <smithpb2250@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer vignesh C <vignesh21@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Amit Kapila <amit.kapila16@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Jeff Davis <pgsql@j-davis.com>
Re: Improve eviction algorithm in ReorderBuffer Jeff Davis <pgsql@j-davis.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Jeff Davis <pgsql@j-davis.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Jeff Davis <pgsql@j-davis.com>
Re: Improve eviction algorithm in ReorderBuffer Jeff Davis <pgsql@j-davis.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Jeff Davis <pgsql@j-davis.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Jeff Davis <pgsql@j-davis.com>
Re: Improve eviction algorithm in ReorderBuffer Jeff Davis <pgsql@j-davis.com>
Re: Improve eviction algorithm in ReorderBuffer Heikki Linnakangas <hlinnaka@iki.fi>
Re: Improve eviction algorithm in ReorderBuffer Jeff Davis <pgsql@j-davis.com>
Re: Improve eviction algorithm in ReorderBuffer Michael Paquier <michael@paquier.xyz>
Re: Improve eviction algorithm in ReorderBuffer Jeff Davis <pgsql@j-davis.com>
Re: Improve eviction algorithm in ReorderBuffer Michael Paquier <michael@paquier.xyz>
Re: Improve eviction algorithm in ReorderBuffer Heikki Linnakangas <hlinnaka@iki.fi>
Re: Improve eviction algorithm in ReorderBuffer Jeff Davis <pgsql@j-davis.com>
Re: Improve eviction algorithm in ReorderBuffer Amit Kapila <amit.kapila16@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Heikki Linnakangas <hlinnaka@iki.fi>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Heikki Linnakangas <hlinnaka@iki.fi>
RE: Improve eviction algorithm in ReorderBuffer "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Michael Paquier <michael@paquier.xyz>
Re: Improve eviction algorithm in ReorderBuffer Heikki Linnakangas <hlinnaka@iki.fi>
RE: Improve eviction algorithm in ReorderBuffer "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Shubham Khanna <khannashubham1197@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Peter Smith <smithpb2250@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Peter Smith <smithpb2250@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Peter Smith <smithpb2250@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Peter Smith <smithpb2250@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Peter Smith <smithpb2250@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer vignesh C <vignesh21@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Masahiko Sawada <sawada.mshk@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Dilip Kumar <dilipbalaut@gmail.com>
Re: Improve eviction algorithm in ReorderBuffer Peter Smith <smithpb2250@gmail.com>
On Mon, 2024-04-01 at 12:42 +0900, Masahiko Sawada wrote:
> While reviewing the patches, I realized the comment of
> binearyheap_allocate() should also be updated. So I've attached the
> new patches.
In sift_{up|down}, each loop iteration calls set_node(), and each call
to set_node does a hash lookup. I didn't measure it, but that feels
wasteful.
I don't even think you really need the hash table. The key to the hash
table is a pointer, so it's not really doing anything that couldn't be
done more efficiently by just following the pointer.
I suggest that you add a "heap_index" field to ReorderBufferTXN that
would point to the index into the heap's array (the same as
bh_nodeidx_entry.index in your patch). Each time an element moves
within the heap array, just follow the pointer to the ReorderBufferTXN
object and update the heap_index -- no hash lookup required.
That's not easy to do with the current binaryheap API. But a binary
heap is not a terribly complex structure, so you can just do an inline
implementation of it where sift_{up|down} know to update the heap_index
field of the ReorderBufferTXN.
Regards,
Jeff Davis
В списке pgsql-hackers по дате отправления
От: Alexander Korotkov
Дата:
От: Jakub Wartak
Дата: