On Tue, 25 Jun 2024 at 10:55, jian he <jian.universal...@gmail.com> wrote: > > for json format, add a new option to let the explain json output also > include the actual query string.
How would this cooperate with e.g. EXPLAIN (...) EXECUTE my_prepared_statement? Would this query be the prepared statement's query, or the top-level EXECUTE statement? > it can make json usage more convenient. > Now you only need to grab the json output, no need to > collect another explain statement and extract the actual query from > the explain statement. Wouldn't the user be able to keep track of the query they wanted explained by themselves? If not, why? > example: > explain (analyze,including_query on, format json) select 1; > QUERY PLAN > ------------------------------------- > [ + > {"Query": "select 1"}, + > { + > "Plan": { + If we were to add the query to the explain output, I think it should be a top-level key in the same JSON object that holds the "Plan", Triggers, and "Execution Time" keys. Kind regards, Matthias van de Meent Neon (https://neon.tech)