Re: Parameterized append subpaths - Mailing list pgsql-hackers

From Gleb Kashkin
Subject Re: Parameterized append subpaths
Date
Msg-id 98f84e7438c5b78a5a1c77539ffc7e0b@postgrespro.ru
Whole thread
Responses Re: Parameterized append subpaths
List pgsql-hackers
Alexander Pyhalov писал(а) 2026-09-09 10:51:

> There's a (likely well known) add_path() issue - it can remove the 
> path, which otherwise would be useful in the future

Hi!

We found another way to address the issue. It could be better suited for 
current path selection model:
Instead of keeping all parameterized foreign paths, we could 
re-parameterize the ones that were left after add_path() domination, as 
is already done with other path types. This requires a new FDW interface 
function, but allows to keep current path domination logic and build 
additional foreign paths only when they are truly required, like in 
parametrized NestLoop.

The first attached patch implements path reparameterization in 
postgres_fwd and adds it to reparameterize_path().
The second patch is optional, it adds a cache for parameterized paths in 
postgres_fdw, so there is no excessive roundtrip for remote estimate 
EXPLAIN for paths that have already been costed and rejected.

-- 
Best regards,
Gleb Kashkin,
Postgres Professional
Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Fix conversion warnings in headers
Next
From: Peter Eisentraut
Date:
Subject: Re: ORDER BY ALL