Record queryid when auto_explain.log_verbose is on - Mailing list pgsql-hackers

From torikoshia
Subject Record queryid when auto_explain.log_verbose is on
Date
Msg-id 1ea21936981f161bccfce05765c03bee@oss.nttdata.com
Whole thread Raw
Responses Re: Record queryid when auto_explain.log_verbose is on
Re: Record queryid when auto_explain.log_verbose is on
List pgsql-hackers
Hi,

As far as I read the manual below, auto_explain.log_verbose should 
record logs equivalent to VERBOSE option of EXPLAIN.

> -- https://www.postgresql.org/docs/devel/auto-explain.html
> auto_explain.log_verbose controls whether verbose details are printed 
> when an execution plan is logged; it's equivalent to the VERBOSE option 
> of EXPLAIN.

However, when compute_query_id is on, query identifiers are only printed 
when using VERBOSE option of EXPLAIN.

EXPLAIN VERBOSE:
```
=# show auto_explain.log_verbose;
  auto_explain.log_verbose
--------------------------
  on
(1 row)

=# show compute_query_id;
  compute_query_id
------------------
  on
(1 row)

=# explain verbose select 1;
                 QUERY PLAN
------------------------------------------
  Result  (cost=0.00..0.01 rows=1 width=4)
    Output: 1
  Query Identifier: -1801652217649936326
(3 rows)
```

auto_explain:
```
LOG:  00000: duration: 0.000 ms  plan:
         Query Text: explain verbose select 1;
         Result  (cost=0.00..0.01 rows=1 width=4)
           Output: 1
```

Attached patch makes auto_explain also print query identifiers.

What do you think?

-- 
Regards,

--
Atsushi Torikoshi
NTT DATA CORPORATION
Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Rethinking the implementation of ts_headline()
Next
From: Aleksander Alekseev
Date:
Subject: Re: [PATCH] Clarify the behavior of the system when approaching XID wraparound