Re: Flush some statistics within running transactions - Mailing list pgsql-hackers

From Sami Imseih
Subject Re: Flush some statistics within running transactions
Date
Msg-id CAA5RZ0vbL8fw4h7JQEuLE5JqLqVbG+7oBKkM_4eONMe=yJ=Veg@mail.gmail.com
Whole thread Raw
In response to Re: Flush some statistics within running transactions  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
Responses Re: Flush some statistics within running transactions
List pgsql-hackers
> For example, pgstat_update_dbstats() updates some of them: xact_commit, xact_rollback,
> blk_read_time, blk_write_time, session_time, active_time and idle_in_transaction_time
> but only at transaction boundaries. Indeed, pgstat_update_dbstats() is only called
> during pgstat_report_stat() and not during pgstat_report_anytime_stat().
>
> I think that we could:
>
> 1. Update the doc as you suggest

I am thinking the _time related fields are OK to be non-anytime
fields, since they
have overhead and also they can be actively monitored from pg_stat_activity
if someone really needs real time information.

The other session related counters don't need need special consideration.

parallel counters are anytime.

So, the documentation can mention the _time related fields that are flushed
only at their appropriate times.

Maybe something general like this:

"Some statistics are updated while a transaction is in progress.
Statistics that either do
not depend on transactions or require transactional consistency are
updated only
when the transaction ends. Statistics that require transactional consistency
include xact_commit, xact_rollback, tup_inserted, tup_updated, and tup_deleted."

What do you think?

--
Sami Imseih
Amazon Web Services (AWS)



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Remove PG_MMAP_FLAGS
Next
From: Ashutosh Bapat
Date:
Subject: Re: Fix rounding method used to compute huge pages