169 похожих чатов

Hi all, is there any provision in Postgresql to know

the number of transactions in all tables in a database for a particular time. Means can we check how many insert/update/delete/select queries executed in each table in a database for a specific time period?

8 ответов

13 просмотров

No. For one, deletes can/will be removed by vacuum statements. On the other hand, you can turn on the track_commit_timestamp feature (GUC). This will let you associate a timestamp to a specific commit. We use this in development. So that we can review EVERY OBJECT that changed (views, Procs, etc) over a period of time. It won't tell me HOW MANY times I saved that view. Or how many views I dropped (or even about Dropped Views). It's the closest concept I can think of.

बैरागी- Автор вопроса
Kirk
No. For one, deletes can/will be removed by vacuu...

Ok. But there must me something to check the excess load on the database for a particular time period

बैरागी
Ok. But there must me something to check the exces...

That is called monitoring and should throw alarms. And to observe statistics over a longer period you could use an extension called https://github.com/vyruss/pg_statviz You'd need pg_stat_activity enabled. Also https://github.com/darold/pgbadger is a good tool. Also auto_explain should be used to get explain from slow queries.

बैरागी- Автор вопроса
Stefanie Janine Stölting
That is called monitoring and should throw alarms....

Pgbadger as I know logs the query response time. But I want to check the total transaction like insert update select in all tables of a database for a specific period for ex 1 hour.

बैरागी
Pgbadger as I know logs the query response time. B...

Write your own stuff or give someone money to slow down your database. That's logging every single statement with all availability transaction information.

बैरागी
Ok. But there must me something to check the exces...

I would look at this from a different perspective: what do You consider an exess load on Your database? Usually, when We look at the data We can see that something isn’t right, presuming We know how data should look and grow. Just trying to find txcount doesn’t make much practical sense unless something is not behaving as it should. It is very hard for people here to give advice on such a broad topic.

बैरागी- Автор вопроса
Milos Eskert
I would look at this from a different perspective:...

I just wanted to know how we can check the number of inserts, update, and select query has been executed in 1 hour in a database?

बैरागी
I just wanted to know how we can check the number ...

You can do snapshots of pg_stat_statement with a cron job every hour, that thing has a counter for each query.

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
14
Добрый день! Скажите пожалуйста, а какие программы вы бы рекомендовали написать для того, чтобы научиться управлять памятью? Можно написать динамический массив, можно связный ...
Филипп
7
Недавно Google Project Zero нашёл багу в SQLite с помощью LLM, о чём достаточно было шумно в определённых интернетах, которые сопровождались рассказами, что скоро всех "ибешни...
Alex Sherbakov
5
Ребят в СИ можно реализовать ООП?
Николай
33
https://github.com/erlang/otp/blob/OTP-27.1/lib/kernel/src/logger_h_common.erl#L174 https://github.com/erlang/otp/blob/OTP-27.1/lib/kernel/src/logger_olp.erl#L76 15 лет назад...
Maksim Lapshin
20
Карта сайта