add a new explain option including_query for include query string inside the json plan output

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: add a new explain option including_query for include query string inside the json plan output
Date: 2024-06-25 08:54:00
Message-ID: CACJufxH33RAWJ26ayKNVV+utgya75RwXEDyCkkxZ38xoRPrCmw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

for json format, add a new option to let the explain json output also
include the actual query string.

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.

including_query name is so far what i can come up with, if people have
better ideas, then we can change.

example:
explain (analyze,including_query on, format json) select 1;
QUERY PLAN
-------------------------------------
[ +
{"Query": "select 1"}, +
{ +
"Plan": { +
"Node Type": "Result", +
"Parallel Aware": false, +
"Async Capable": false, +
"Startup Cost": 0.00, +
"Total Cost": 0.01, +
"Plan Rows": 1, +
"Plan Width": 4, +
"Actual Startup Time": 0.001,+
"Actual Total Time": 0.001, +
"Actual Rows": 1, +
"Actual Loops": 1 +
}, +
"Planning Time": 0.119, +
"Triggers": [ +
], +
"Execution Time": 0.033 +
} +
]
(1 row)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2024-06-25 09:11:16 RE: Slow catchup of 2PC (twophase) transactions on replica in LR
Previous Message Amit Kapila 2024-06-25 08:32:09 Re: New standby_slot_names GUC in PG 17