Re: Subquery pull-up increases jointree search space

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: Tomas Vondra <tomas(at)vondra(dot)me>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Subquery pull-up increases jointree search space
Date: 2026-06-09 11:29:45
Message-ID: f81a217c-333c-4e28-8a38-8c81ad46af5d@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/06/2026 12:43, Tomas Vondra wrote:
> I'm not sure what to do about this. I suppose it'd be good to have a
> better idea if the path got used, in some way.

Looking ahead, I believe Tom's idea of using a selectivity-estimation memory
context can help lower memory spikes when working with massive clauses.

A combination of Ashutosh's 'smart references' [2] and a per-RelOptInfo memory
context might reduce memory usage even further. Right now, partitionwise-enabled
planning with parameterised join paths can lead to high peak memory usage due to
reparameterisation copy.

[1] https://www.postgresql.org/message-id/1367418.1708816059@sss.pgh.pa.us
[2]
https://www.postgresql.org/message-id/CAExHW5tUcVsBkq9qT=L5vYz4e-cwQNw=KAGJrtSyzOp3F=XacA@mail.gmail.com

--
regards, Andrei Lepikhov,
pgEdge

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shlok Kyal 2026-06-09 11:32:00 Re: [PATCH] Preserve replication origin OIDs in pg_upgrade
Previous Message Rafia Sabih 2026-06-09 11:29:26 Re: postgres_fdw: Emit message when batch_size is reduced