Re: plan with result cache is very slow when work_mem is not enough

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: plan with result cache is very slow when work_mem is not enough
Дата
Msg-id CAApHDvqn17xP4yVkoYsTNu4X=1srN62z_MK5Wfca-Of1h_-Ycw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: plan with result cache is very slow when work_mem is not enough  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
On Sat, 8 May 2021 at 14:43, Justin Pryzby <pryzby@telsasoft.com> wrote:
> You could put this into a separate function called by ExecEndResultCache().
> Then anyone that breaks the memory accounting can also call the function in the
> places they changed to help figure out what they broke.

I almost did it that way and left a call to it in remove_cache_entry()
#ifdef'd out.  However, as mentioned, I'm more concerned about the
accounting being broken and left broken than I am with making it take
a little less time to find the exact place to fix the breakage.  If
the breakage was to occur when adding a new entry to the cache then it
might not narrow it down much if we just give users an easy way to
check the memory accounting during only evictions. The only way to
highlight the problem as soon as it occurs would be to validate the
memory tracking every time the mem_used field is changed. I think that
would be overkill.

I also find it hard to imagine what other reasons we'll have in the
future to adjust 'mem_used'.  At the moment there are 4 places. Two
that add bytes and two that subtract bytes. They're all hidden inside
reusable functions that are in charge of adding and removing entries
from the cache.

David



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Japin Li
Дата:
Сообщение: Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns
Следующее
От: Noah Misch
Дата:
Сообщение: Re: Anti-critical-section assertion failure in mcxt.c reached by walsender