I am setting up a monitoring system for a PostgreSQL database and I am checking pg_stat_statements
, however I have noticed this:
SELECT queryid, query FROM pg_stat_statements WHERE query LIKE '%UPDATE pgbench_tellers%';
results in:
8899387537716482989,UPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2
5800668169761729302,UPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2
-3652521024179043160,UPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2
-8908321420070439827,UPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2
Why is that so? Shouldn't be the same?
NOTE:
I am running pg_bench at 1 hour intervals, I suspect this has something to do with it as those new ids seems to be recorded exactly every hour.