Thread: PostgreSQL 9.3 - pg_stat_database - tup_returned got "too high" value
I've got a "problem" with stats at PostgreSQL 9.3. Problem can coupe(?) sources:
a) I do not understand what values should tup_returned contain
b) tup_returned contains something else than can be understood by reading official docs
c) something is wrong with our database "server"
According to docs (http://www.postgresql.org/docs/9.3/static/monitoring-stats.html):
tup_returned bigint Number of rows returned by queries in this database
Imagine following query and result:
pgsql=# SELECT datname, connections, queries, tup_returned FROM pg_stat_database WHERE datname = 'dbname';
datname | connections | queries | tup_returned
----------+-------------+---------+--------------
dbname | 0 | 1 | 39824
(1 row)
What's my problem? This (test) database isn't used by any user/script, password was set randomly and I don't even know it. Database is left untouched, tup_returned climbs quite high at rate ~ 65k per hour. btw. there's only one table with 2 rows inside.
Same thing happens for all 9.3 instances in all databases configured in our environment.
I'd be very glad if someone could explain to me what should I expect from tup_returned or how can I meter "rows returned from database".
Best regards,
Borys Gogulski
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Borys Gogulski
Sent: Monday, October 20, 2014 5:25 AM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] PostgreSQL 9.3 - pg_stat_database - tup_returned got "too high" value
Hello,
I've got a "problem" with stats at PostgreSQL 9.3. Problem can coupe(?) sources:
a) I do not understand what values should tup_returned contain
b) tup_returned contains something else than can be understood by reading official docs
c) something is wrong with our database "server"
According to docs (http://www.postgresql.org/docs/9.3/static/monitoring-stats.html):
tup_returned bigint Number of rows returned by queries in this database
Imagine following query and result:
pgsql=# SELECT datname, connections, queries, tup_returned FROM pg_stat_database WHERE datname = 'dbname';
datname | connections | queries | tup_returned
----------+-------------+---------+--------------
dbname | 0 | 1 | 39824
(1 row)
What's my problem? This (test) database isn't used by any user/script, password was set randomly and I don't even know it. Database is left untouched, tup_returned climbs quite high at rate ~ 65k per hour. btw. there's only one table with 2 rows inside.
Same thing happens for all 9.3 instances in all databases configured in our environment.
I'd be very glad if someone could explain to me what should I expect from tup_returned or how can I meter "rows returned from database".
Best regards,
Borys Gogulski
Querying pg_stat_all_tables could provide more info pointing to particular table, it could dictionary table (from pg_catalog) – not one of your users tables.
Regards,
Igor Neyman