Feature improvement for pg_stat_statements

From: btnakamichin <btnakamichin(at)oss(dot)nttdata(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Feature improvement for pg_stat_statements
Date: 2020-09-18 08:55:12
Message-ID: c102cf3180d0ee73c1c5a0f7f8558322@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2020-09-18 09:39:53 Re: pgbench calculates summary numbers a wrong way.
Previous Message Katsuragi Yuta 2020-09-18 08:53:44 [PATCH] Add features to pg_stat_statements