*
* pgsp_json_text.h: Text plan generator for pg_store_plans.
*
- * Copyright (c) 2012-2020, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
+ * Copyright (c) 2012-2021, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
*
* IDENTIFICATION
* pg_store_plans/pgsp_json_text.c
SETTERDECL(strategy)
{
word_table *p;
-
+
p = search_word_table(strategies, val, PGSP_JSON_TEXTIZE);
if (!p)
DEFAULT_SETTER(workers_planned);
DEFAULT_SETTER(workers_launched);
BOOL_SETTER(inner_unique);
+BOOL_SETTER(async_capable);
DEFAULT_SETTER(table_func_name);
LIST_SETTER(presorted_key);
LIST_SETTER(sortmethod_used);
print_prop(s, prepstr, prop, level, exind);
}
-static void
+static void
print_current_node(pgspParserContext *ctx)
{
node_vals *v = ctx->nodevals;
* would be named T_Worker if there were in node.h. So it needs a special
* treat.
*/
-
+
if (v->node_type == T_Invalid && !HASSTRING(v->worker_number))
return;
if (v->parallel_aware)
appendStringInfoString(s, "Parallel ");
+ if (v->async_capable)
+ appendStringInfoString(s, "Async ");
+
switch (v->nodetag)
{
case T_ModifyTable:
appendStringInfoString(s, "Worker");
print_prop_if_exists(s, " ", v->worker_number, 0, 0);
- /*
+ /*
* "Worker"s are individual JSON objects in a JSON list but
* should be printed as just a property in text
* representaion. Correct indent using exind here.
appendStringInfoSpaces(s, TEXT_INDENT_DETAILS(level, exind));
appendStringInfoString(s, str);
}
-
+
print_propstr_if_exists(s, "Output: ", v->output, level, exind);
print_propstr_if_exists(s, "Group Key: ", v->group_key, level, exind);
print_groupingsets_if_exists(s, v->grouping_sets, level, exind);
if (v->repeatable_seed)
appendStringInfo(s, " REPEATABLE (%s)", v->repeatable_seed);
}
-
+
print_propstr_if_exists(s, "Sort Key: ", v->sort_key, level, exind);
if (HASSTRING(v->sort_method))
{
/* Feed a line if any of Buffers: items has been shown */
if (comma)
appendStringInfoString(s, "\n");
-
+
appendStringInfoSpaces(s, TEXT_INDENT_DETAILS(level, exind));
appendStringInfoString(s, "I/O Timings: ");
}
/* Move working grouping set into nodevals */
- ctx->nodevals->grouping_sets =
+ ctx->nodevals->grouping_sets =
lappend(v->grouping_sets, ctx->tmp_gset);
ctx->tmp_gset = NULL;
}
ctx->level--;
}
-static void
+static void
json_text_arrstart(void *state)
{
pgspParserContext *ctx = (pgspParserContext *)state;
if (ctx.dest->len > 0 &&
ctx.dest->data[ctx.dest->len - 1] != '\n')
appendStringInfoChar(ctx.dest, '\n');
-
+
if (ctx.dest->len == 0)
appendStringInfoString(ctx.dest, "<Input was not JSON>");
else