public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andrei Lepikhov <[email protected]>
To: PostgreSQL Hackers <[email protected]>
Cc: Tom Lane <[email protected]>
Subject: Short-living Memory Context in the optimiser
Date: Wed, 25 Dec 2024 11:56:24 +0700
Message-ID: <[email protected]> (raw)

Hi,

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

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] https://www.postgresql.org/message-id/[email protected]

-- 
regards, Andrei Lepikhov







view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Short-living Memory Context in the optimiser
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox