Re: Force streaming every change in logical decoding
От | Amit Kapila |
---|---|
Тема | Re: Force streaming every change in logical decoding |
Дата | |
Msg-id | CAA4eK1+bPXbcbMar_fcNjmDCyhG4v9Bre-2nDjjtxkEg7eUzpg@mail.gmail.com обсуждение исходный текст |
Ответ на | RE: Force streaming every change in logical decoding ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>) |
Список | pgsql-hackers |
On Fri, Dec 23, 2022 at 10:48 AM Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com> wrote: > > ``` > + * If logical_decoding_mode is immediate, loop until there's no change. > + * Otherwise, loop until we reach under the memory limit. One might think > + * that just by evicting the largest (sub)transaction we will come under > + * the memory limit based on assumption that the selected transaction is > + * at least as large as the most recent change (which caused us to go over > + * the memory limit). However, that is not true because a user can reduce > + * the logical_decoding_work_mem to a smaller value before the most recent > * change. > */ > ``` > > Do we need to pick the largest (sub)transaciton even if we are in the immediate mode? > It seems that the liner search is done in ReorderBufferLargestStreamableTopTXN() > to find the largest transaction, but in this case we can choose the arbitrary one. > In immediate mode, we will stream/spill each change, so ideally, we don't need to perform any search. Otherwise, also, I think changing those functions will complicate the code without serving any purpose. -- With Regards, Amit Kapila.
В списке pgsql-hackers по дате отправления: