Re: Should pg 11 use a lot more memory building an spgist index?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Should pg 11 use a lot more memory building an spgist index?
Дата
Msg-id 15917.1541020889@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Should pg 11 use a lot more memory building an spgist index?  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Ответы Re: Should pg 11 use a lot more memory building an spgist index?  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-hackers
Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> writes:
> Maybe, we don't need to spoil the interface of index_beginscan with the
> new memory context argument like my patch does if the simple following of
> its contract by amendscan would suffice.

Yeah, I'm not enamored of changing the API of index_beginscan for this;
the existing convention that it should allocate in CurrentMemoryContext
seems perfectly suitable.  And changing it would create a lot of code
churn, not only for us but for externally-maintained AMs.

What is at stake is changing the API of amendscan, to specify that it
need not release memory because the current context is expected to be
destroyed or reset shortly after ending the scan.  Then, for the small
number of call sites where that wouldn't be true, it's on those callers
to set up a suitable context and switch into it.  Note this is actually
forwards compatible, in that an AM that's still following the convention
of releasing stuff manually would not be broken.

            regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Parallel threads in query
Следующее
От: David Rowley
Дата:
Сообщение: Re: PostgreSQL Limits and lack of documentation about them.