Subject: Re: Quadratic planning time for ordered paths over partitioned tables

From: Alvaro Herrera <[email-masked]>
Date: Wed, 22 Jan 2025 17:36:19 +0100

Hello,

On 2025-Jan-22, Alexander Kuzmenkov wrote:

> Hi hackers,
> 
> There's currently an unfortunate CPU sink in the planning for
> partitioned tables. It happens both for the declarative partitioning,
> and for the partitioning through inheritance like we use in
> TimescaleDB.
> 
> The gist of it is that there's a linear search of the EM corresponding
> to the given child relation in find_ec_member_matching_pathkeys().

I think this is closely related to the work Yuya Watari has been doing
at
https://postgr.es/m/[email-masked]
Perhaps you could contribute by reviewing that patch series.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Los cuentos de hadas no dan al niño su primera idea sobre los monstruos.
Lo que le dan es su primera idea de la posible derrota del monstruo."
                                                   (G. K. Chesterton)