Short-living Memory Context in the optimiser

Started by Andrei Lepikhovover 1 year ago3 messageshackers
Jump to latest
#1Andrei Lepikhov
lepihov@gmail.com

Hi,

Here is a rebased and slightly commented Tom's patch separated from the
discussion [1]/messages/by-id/1367418.1708816059@sss.pgh.pa.us.

I still occasionally see that planner peak memory consumption is
triggered by selectivity estimation of massive arrays and clauses
generated for multiple partitions.
I think that in case of a growing number of selectivity estimations, the
planner should consume memory in some scalable manner, so this thread is
an attempt to draw community attention to this issue.

I question some decisions in that patch. For example, field 'depth' and
even 'usage' can be incorporated inside the MemoryContext structure.
This can make the reset function safer. To avoid overhead, it may be
used only for the 'short-living' class of memory contexts, which can be
declared with an additional parameter of AllocSetContextCreate on a
context creation.

[1]: /messages/by-id/1367418.1708816059@sss.pgh.pa.us

--
regards, Andrei Lepikhov

#2Michael Paquier
michael@paquier.xyz
In reply to: Andrei Lepikhov (#1)
Re: Short-living Memory Context in the optimiser

On Wed, Dec 25, 2024 at 11:56:24AM +0700, Andrei Lepikhov wrote:

Here is a rebased and slightly commented Tom's patch separated from the
discussion [1].

Seems to me that there is no patch?
--
Michael

#3Andrei Lepikhov
lepihov@gmail.com
In reply to: Michael Paquier (#2)
Re: Short-living Memory Context in the optimiser

On 12/25/24 12:30, Michael Paquier wrote:

On Wed, Dec 25, 2024 at 11:56:24AM +0700, Andrei Lepikhov wrote:

Here is a rebased and slightly commented Tom's patch separated from the
discussion [1].

Seems to me that there is no patch?
--
Michael

Pardon me, patch attached.

--
regards, Andrei Lepikhov

Attachments:

v0-0001-Introduce-planner-temporary-memory-context.patchtext/x-patch; charset=UTF-8; name=v0-0001-Introduce-planner-temporary-memory-context.patchDownload+86-6