Feature improvement for pg_stat_statements - Mailing list pgsql-hackers

From btnakamichin
Subject Feature improvement for pg_stat_statements
Date
Msg-id c102cf3180d0ee73c1c5a0f7f8558322@oss.nttdata.com
Whole thread Raw
Responses Re: Feature improvement for pg_stat_statements  (Adam Brusselback <adambrusselback@gmail.com>)
Re: Feature improvement for pg_stat_statements  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Hello.

I’d like to improve pg_stat_statements so that it can report the 
timestamp when the stats are reset. Currently it’s difficult to check 
that reset timestamp. But this information is useful, for example, when 
calculating the SQL executions per second by SELECT calls / (now() - 
reset_timestamp) FROM pg_stat_statements.

I’m thinking of adding adding a function called 
pg_stat_statements_reset_time() that returns the last timestamp when 
executed pg_stat_statements_reset(). pg_stat_statements can reset each 
SQL statement. We can record each sql reset timing timestamp but I don’t 
feel the need. This time, I’m thinking of updating the reset timestamp 
only when all stats were reset.

what do you think ?
Regards.

Naoki Nakamichi



pgsql-hackers by date:

Previous
From: Katsuragi Yuta
Date:
Subject: [PATCH] Add features to pg_stat_statements
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: pgbench calculates summary numbers a wrong way.