Re: Fix log_line_prefix to display the transaction id (%x) for statements not in a transaction block - Mailing list pgsql-hackers

From jian he
Subject Re: Fix log_line_prefix to display the transaction id (%x) for statements not in a transaction block
Date
Msg-id CACJufxHg1oir8sd=xScMP3n+tYcbug=zusG5KiA2KzH5PmOeuQ@mail.gmail.com
Whole thread Raw
In response to Re: Fix log_line_prefix to display the transaction id (%x) for statements not in a transaction block  (jian he <jian.universality@gmail.com>)
Responses Re: Fix log_line_prefix to display the transaction id (%x) for statements not in a transaction block
Re: Fix log_line_prefix to display the transaction id (%x) for statements not in a transaction block
List pgsql-hackers
Hi
another big  difference compare to HEAD:

select  name,setting
        from    pg_settings
        where name in
        ('auto_explain.log_timing','auto_explain.log_analyze',
'auto_explain.log_min_duration','log_statement','log_line_prefix')
    ;
             name              |          setting
-------------------------------+----------------------------
 auto_explain.log_analyze      | on
 auto_explain.log_min_duration | 0
 auto_explain.log_timing       | on
 log_line_prefix               | %m [%p] %q%u@%d/%a XID:%x
 log_statement                 | all

simple query: explain(analyze, costs off) select 1 from pg_sleep(10);

with patch:
src3=# explain(analyze, costs off) select 1 from pg_sleep(10);
2024-01-12 08:43:14.750 CST [5739] jian@src3/psql XID:0 LOG:
duration: 10010.167 ms  plan:
        Query Text: explain(analyze, costs off) select 1 from pg_sleep(10);
        Function Scan on pg_sleep  (cost=0.00..0.01 rows=1 width=4)
(actual time=10010.155..10010.159 rows=1 loops=1)
2024-01-12 08:43:14.750 CST [5739] jian@src3/psql XID:0 LOG:
statement: explain(analyze, costs off) select 1 from pg_sleep(10);
                                 QUERY PLAN
-----------------------------------------------------------------------------
 Function Scan on pg_sleep (actual time=10010.155..10010.159 rows=1 loops=1)
 Planning Time: 0.115 ms
 Execution Time: 10010.227 ms
(3 rows)

without patch:

src4=#
src4=# explain(analyze, costs off) select 1 from pg_sleep(10);
2024-01-12 08:43:13.462 CST [5869] jian@src4/psql XID:0 LOG:
statement: explain(analyze, costs off) select 1 from pg_sleep(10);
2024-01-12 08:43:23.473 CST [5869] jian@src4/psql XID:0 LOG:
duration: 10010.133 ms  plan:
        Query Text: explain(analyze, costs off) select 1 from pg_sleep(10);
        Function Scan on pg_sleep  (cost=0.00..0.01 rows=1 width=4)
(actual time=10010.126..10010.128 rows=1 loops=1)
                                 QUERY PLAN
-----------------------------------------------------------------------------
 Function Scan on pg_sleep (actual time=10010.126..10010.128 rows=1 loops=1)
 Planning Time: 0.031 ms
 Execution Time: 10010.172 ms
(3 rows)



pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: Confine vacuum skip logic to lazy_scan_skip
Next
From: "Shinoda, Noriyoshi (HPE Services Japan - FSIP)"
Date:
Subject: RE: cleanup patches for incremental backup