Re: explain plans for foreign servers

From: solai v <solai(dot)cdac(at)gmail(dot)com>
To: dinesh salve <cooltodinesh(at)gmail(dot)com>
Cc: 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>, Yilin Zhang <jiezhilove(at)126(dot)com>
Subject: Re: explain plans for foreign servers
Date: 2026-08-05 10:31:18
Message-ID: CAF0whuedJhPVgXsBf=0jHcHTU0FjvDP-wd04Fnuz3T7aL9Bq=Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Dinesh,

I tested the latest v6 patch. I set up two PostgreSQL instances (one
local and one remote) connected through postgres_fdw, created a
foreign table, and verified the behavior before and after applying the
patch.
Before applying the patch, EXPLAIN on the foreign table only displayed
a Foreign Scan node. EXPLAIN (VERBOSE) showed the generated Remote
SQL, but it did not provide any information about how the remote
PostgreSQL server planned to execute the query.

After applying the patch, rebuilding PostgreSQL, and restarting both
instances, I verified that EXPLAIN (REMOTE_PLANS) now displays a new
Remote Plans section. The output correctly included the execution plan
generated by the remote PostgreSQL server (for example, Seq Scan on
emp) along with the corresponding Plan Node ID.

I also verified the following:
EXPLAIN (REMOTE_PLANS) successfully displays the remote execution plan.
EXPLAIN (REMOTE_PLANS) with a WHERE clause correctly reflects the
filter condition in the remote plan.
EXPLAIN (REMOTE_PLANS, VERBOSE) continues to display the existing
Remote SQL output together with the new Remote Plans section.
EXPLAIN (REMOTE_PLANS, ANALYZE) correctly reports:
ERROR: EXPLAIN options REMOTE_PLANS and ANALYZE cannot be used together

which matches the current implementation.
I did not encounter any issues during my testing, and the feature
behaved as expected in the scenarios I tested.

Thanks for working on this feature.

Regards,
solai

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ZizhuanLiu X-MAN 2026-08-05 10:31:34 Re: Fix var_eq_const: sum selectivity of all matching MCV entries instead of stopping at first match
Previous Message Michael Paquier 2026-08-05 10:12:35 Re: Fix archive restore race that could unlink WAL before rename