Re: explain plans for foreign servers

From: "Yilin Zhang" <jiezhilove(at)126(dot)com>
To: "Dinesh Salve" <cooltodinesh(at)gmail(dot)com>
Cc: "solai v" <solai(dot)cdac(at)gmail(dot)com>, "Bharath Rupireddy" <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, "Sami Imseih" <samimseih(at)gmail(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, "Jeff Davis" <pgsql(at)j-davis(dot)com>
Subject: Re: explain plans for foreign servers
Date: 2026-08-07 01:27:30
Message-ID: 5b33d1f8.da9.19fd9d51dbc.Coremail.jiezhilove@126.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 2026-08-05 18:47:51, "Dinesh Salve" <cooltodinesh(at)gmail(dot)com> wrote:
Thanks a lot Solai for testing the patch, appreciate it.

Hi Bharath,
Thanks for the inputs, attached v7 patch to make review easier.

> IMO, we don't need to print all the flavors of explain plans
I have removed formatting related tests from file postgres_fdw.sql and moved to a separate file remote_plans_formats.sql.
We still need tests around formatting as my changes introduce some new elements.

> Another point, why are we not supporting explain analyze?
This will be part of follow-up work, I wanted agreement on the shape first from the community.
One design I considered is an auto_explain-style GUC asking the remote to emit the plan for the statement it is already
running, but we cannot assume an arbitrary foreign server has that, so it needs a fallback and more thought.

> 1/ Why not get the extension id at once in _PG_init
Fixed, also I moved all the EXPLAIN plumbing into postgres_fdw.c behind postgres_fdw_explain_init(), called from
_PG_init. The extension id, the saved hook pointers and both hook functions are now static.

Addressed other comments regarding documentation around GENERIC_PLAN option and added error case handling non-existent remote table.

Hi,
Thanks for Dinesh's recent patch, LGTM.

Best regards,

--

Yilin Zhang

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-08-07 01:39:04 Re: Redesign per-backend statistics
Previous Message Michael Paquier 2026-08-07 01:15:58 Re: Credits For v19