MCPcopy Create free account
hub / github.com/apache/cloudberry / ExplainBeginOutput

Function ExplainBeginOutput

src/backend/commands/explain.c:5892–5918  ·  view source on GitHub ↗

* Emit the start-of-output boilerplate. * * This is just enough different from processing a subgroup that we need * a separate pair of subroutines. */

Source from the content-addressed store, hash-verified

5890 * a separate pair of subroutines.
5891 */
5892void
5893ExplainBeginOutput(ExplainState *es)
5894{
5895 switch (es->format)
5896 {
5897 case EXPLAIN_FORMAT_TEXT:
5898 /* nothing to do */
5899 break;
5900
5901 case EXPLAIN_FORMAT_XML:
5902 appendStringInfoString(es->str,
5903 "<explain xmlns=\"http://www.postgresql.org/2009/explain\">\n");
5904 es->indent++;
5905 break;
5906
5907 case EXPLAIN_FORMAT_JSON:
5908 /* top-level structure is an array of plans */
5909 appendStringInfoChar(es->str, '[');
5910 es->grouping_stack = lcons_int(0, es->grouping_stack);
5911 es->indent++;
5912 break;
5913
5914 case EXPLAIN_FORMAT_YAML:
5915 es->grouping_stack = lcons_int(0, es->grouping_stack);
5916 break;
5917 }
5918}
5919
5920/*
5921 * Emit the end-of-output boilerplate.

Callers 2

explain_ExecutorEndFunction · 0.85
ExplainQueryFunction · 0.85

Calls 3

appendStringInfoStringFunction · 0.85
appendStringInfoCharFunction · 0.85
lcons_intFunction · 0.85

Tested by

no test coverage detected