Answer the question
In order to leave comments, you need to log in
PostgreSQL. How to count the number of insert operations in a table?
Is it possible to count the number of INSERTs into a table over a certain period of time?
As far as I understand, information about all transactions is stored in logs. Is it possible to extract statistics from them using SQL?
Answer the question
In order to leave comments, you need to log in
I won’t tell you about the log, but as an option, you can create a trigger www.postgresql.org/docs/9.1/static/sql-createtrigg... on INSERT and fix the date of each INSERT in some table
According to the data that has already passed - only by manual analysis of WAL, and then it is also rotated.
If there is any monitoring or you can make a background task:
select "n_tup_ins" from "pg_catalog"."pg_stat_user_tables" where "relname" = '<tablename>';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question