public inbox for [email protected]
help / color / mirror / Atom feedFrom: Sami Imseih <[email protected]>
To: Tom Lane <[email protected]>
Cc: Jeff Davis <[email protected]>
Cc: dinesh salve <[email protected]>
Cc: [email protected]
Subject: Re: explain plans for foreign servers
Date: Wed, 5 Mar 2025 13:26:15 -0600
Message-ID: <CAA5RZ0uPt13vOirJ4-__HFT0QSZNEmSS_szYii_Aimc=yBDHEw@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAP+B4TD=iy-C2EnsrJgjpwSc7_4pd3Xh-gFzA0bwsw3q8u860g@mail.gmail.com>
<CAA5RZ0vXiOiodrNQ-Va4FCAkXMpGA=GZDeKjFBRgRvHGuW7s7Q@mail.gmail.com>
<[email protected]>
<[email protected]>
>> What if we do something like a new EXPLAIN option which returns all
>> the rows
>> back to the client, and then writes out the plan to some local
>> memory.
> That's another idea, but I am starting to think returning two result
> sets from EXPLAIN ANALYZE would be generally useful.
I did not think that would be doable. Because a
ForeignScanNode for postgres_fdw is a DECLARE CURSOR
followed by a serious of FETCH statements and finally a CLOSE,
I suspect we can store the plan in memory when the cursor is closed
and then it's up to the fdw to call a remote sql to fetch the plan to the
other side to append it on top of the explain output.
I also thought about 2 options 1/ new EXPLAIN option to do this -or-
2/ put in core GUCs to allow storing the last plan in memory at
ExecutorEnd.
>> I wonder if Robert's extensible EXPLAIN work[1] could be useful
>> here?
> I'm wondering the same. You could certainly imagine cramming
> all of the foreign EXPLAIN output into some new field attached
> to the ForeignScan node. Readability and indentation would
> require some thought, but the other approaches don't have any
> mechanism for addressing that at al
FWIW, I had the same thought [0] and planned on doing the investigation.
[0] https://www.postgresql.org/message-id/CAA5RZ0tLrNOw-OgPkv49kbNmZS4nFn9vzpN5HXX_xvOaM9%3D5ww%40mail.g...
--
Sami Imseih
view thread (2+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: explain plans for foreign servers
In-Reply-To: <CAA5RZ0uPt13vOirJ4-__HFT0QSZNEmSS_szYii_Aimc=yBDHEw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox