Re: Record queryid when auto_explain.log_verbose is on

Поиск
Список
Период
Сортировка
От Julien Rouhaud
Тема Re: Record queryid when auto_explain.log_verbose is on
Дата
Msg-id 20230116130729.yyqqavea2rj7nlot@jrouhaud
обсуждение исходный текст
Ответ на Record queryid when auto_explain.log_verbose is on  (torikoshia <torikoshia@oss.nttdata.com>)
Список pgsql-hackers
Hi,

On Mon, Jan 16, 2023 at 09:36:59PM +0900, torikoshia wrote:
>
> As far as I read the manual below, auto_explain.log_verbose should record
> logs equivalent to VERBOSE option of EXPLAIN.

Ah good catch, that's clearly an oversight!

> Attached patch makes auto_explain also print query identifiers.
>
> What do you think?

@@ -407,6 +408,9 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
                 ExplainPrintTriggers(es, queryDesc);
             if (es->costs)
                 ExplainPrintJITSummary(es, queryDesc);
+            if (es->verbose && queryDesc->plannedstmt->queryId != UINT64CONST(0))
+                ExplainPropertyInteger("Query Identifier", NULL, (int64)
+                                       queryDesc->plannedstmt->queryId, es);

For interactive EXPLAIN the query identifier is printed just after the plan,
before the triggers and the JIT summary so auto_explain should do the same.

Other than that looks good to me.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Xing Guo
Дата:
Сообщение: Re: PL/Python: Fix return in the middle of PG_TRY() block.
Следующее
От: Ajin Cherian
Дата:
Сообщение: Re: Support logical replication of DDLs