Skip to content

Commit 7f2274d

Browse files
authored
Remove the tuples returned/s metric from the header (#447)
The metric was a bit misleader because it does not show the actual row counts returned to the calling applications as users might assume.
1 parent 6990bf0 commit 7f2274d

15 files changed

+15
-37
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
### Fixed
66

77
* Strip comments from SQL queries emitted by pg\_activity (#442).
8+
* Remove the "tuples returned/s" metric from the header, it provided misleading
9+
information (#441, reported by @kmoppel)
810

911
## pg\_activity 3.6.1 - 2025-06-03
1012

docs/man/pg_activity.1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
.\" ========================================================================
5959
.\"
6060
.IX Title "PG_ACTIVITY 1"
61-
.TH PG_ACTIVITY 1 2025-06-03 "pg_activity 3.6.1" "Command line tool for PostgreSQL server activity monitoring."
61+
.TH PG_ACTIVITY 1 2025-10-27 "pg_activity 3.6.1" "Command line tool for PostgreSQL server activity monitoring."
6262
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
6363
.\" way too many mistakes in technical documents.
6464
.if n .ad l
@@ -127,8 +127,6 @@ Activity :
127127
.IX Item "- updates/s: number of updates per second (filtered);"
128128
.IP "\- \fBdelete/s\fR: number of deletes per second (filtered);" 2
129129
.IX Item "- delete/s: number of deletes per second (filtered);"
130-
.IP "\- \fBtuples returned/s\fR: number of tuples returned per second (filtered);" 2
131-
.IX Item "- tuples returned/s: number of tuples returned per second (filtered);"
132130
.IP "\- \fBtemp files\fR: number of temporary files created on the instance;" 2
133131
.IX Item "- temp files: number of temporary files created on the instance;"
134132
.IP "\- \fBtemp size\fR: total temporary file size on the instance." 2

docs/man/pg_activity.pod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ Activity :
7272

7373
=item - B<delete/s>: number of deletes per second (filtered);
7474

75-
=item - B<tuples returned/s>: number of tuples returned per second (filtered);
76-
7775
=item - B<temp files>: number of temporary files created on the instance;
7876

7977
=item - B<temp size>: total temporary file size on the instance.

pgactivity/data.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def pg_get_server_information(
351351

352352
hr: Pct | None = None
353353
rr: Pct | None = None
354-
tps, ips, ups, dps, rps = 0, 0, 0, 0, 0
354+
tps, ips, ups, dps = 0, 0, 0, 0
355355
size_ev = 0.0
356356
if prev_server_info is not None:
357357
dt = float(ret["epoch"] - prev_server_info.epoch)
@@ -362,9 +362,6 @@ def pg_get_server_information(
362362
ips = int((ret["insert"] - prev_server_info.insert) / dt)
363363
ups = int((ret["update"] - prev_server_info.update) / dt)
364364
dps = int((ret["delete"] - prev_server_info.delete) / dt)
365-
rps = int(
366-
(ret["tuples_returned"] - prev_server_info.tuples_returned) / dt
367-
)
368365
deltaread = ret["blks_read"] - prev_server_info.blks_read
369366
deltahit = ret["blks_hit"] - prev_server_info.blks_hit
370367
if deltaread + deltahit != 0:
@@ -382,7 +379,6 @@ def pg_get_server_information(
382379
insert_per_second=ips,
383380
update_per_second=ups,
384381
delete_per_second=dps,
385-
tuples_returned_per_second=rps,
386382
cache_hit_ratio_last_snap=hr,
387383
rollback_ratio_last_snap=rr,
388384
temporary_file=temporary_file_info,

pgactivity/queries/get_server_info_oldest.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ WITH dbinfo AS(
66
COALESCE(SUM(tup_inserted)::BIGINT, 0) AS insert,
77
COALESCE(SUM(tup_updated)::BIGINT, 0) AS update,
88
COALESCE(SUM(tup_deleted)::BIGINT, 0) AS delete,
9-
COALESCE(SUM(tup_returned)::BIGINT, 0) AS tuples_returned,
109
COALESCE(CASE
1110
WHEN %(skip_db_size)s THEN %(prev_total_size)s
1211
ELSE SUM(pg_database_size(d.datname))

pgactivity/queries/get_server_info_post_090100.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ WITH dbinfo AS(
77
COALESCE(SUM(tup_inserted)::BIGINT, 0) AS insert,
88
COALESCE(SUM(tup_updated)::BIGINT, 0) AS update,
99
COALESCE(SUM(tup_deleted)::BIGINT, 0) AS delete,
10-
COALESCE(SUM(tup_returned)::BIGINT, 0) AS tuples_returned,
1110
COALESCE(CASE
1211
WHEN %(skip_db_size)s THEN %(prev_total_size)s
1312
ELSE SUM(pg_database_size(d.datname))

pgactivity/queries/get_server_info_post_090200.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ WITH dbinfo AS(
77
COALESCE(SUM(tup_inserted)::BIGINT, 0) AS insert,
88
COALESCE(SUM(tup_updated)::BIGINT, 0) AS update,
99
COALESCE(SUM(tup_deleted)::BIGINT, 0) AS delete,
10-
COALESCE(SUM(tup_returned)::BIGINT, 0) AS tuples_returned,
1110
COALESCE(CASE
1211
WHEN %(skip_db_size)s THEN %(prev_total_size)s
1312
ELSE SUM(pg_database_size(d.datname))

pgactivity/queries/get_server_info_post_090400.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ WITH dbinfo AS(
1010
COALESCE(SUM(tup_inserted)::BIGINT, 0) AS insert,
1111
COALESCE(SUM(tup_updated)::BIGINT, 0) AS update,
1212
COALESCE(SUM(tup_deleted)::BIGINT, 0) AS delete,
13-
COALESCE(SUM(tup_returned)::BIGINT, 0) AS tuples_returned,
1413
COALESCE(CASE
1514
WHEN %(skip_db_size)s THEN %(prev_total_size)s
1615
ELSE SUM(pg_database_size(d.datname))

pgactivity/queries/get_server_info_post_090600.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ WITH dbinfo AS(
88
COALESCE(SUM(tup_inserted)::BIGINT, 0) AS insert,
99
COALESCE(SUM(tup_updated)::BIGINT, 0) AS update,
1010
COALESCE(SUM(tup_deleted)::BIGINT, 0) AS delete,
11-
COALESCE(SUM(tup_returned)::BIGINT, 0) AS tuples_returned,
1211
COALESCE(CASE
1312
WHEN %(skip_db_size)s THEN %(prev_total_size)s
1413
ELSE SUM(pg_database_size(d.datname))

pgactivity/queries/get_server_info_post_100000.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ WITH dbinfo AS(
99
COALESCE(SUM(tup_inserted)::BIGINT, 0) AS insert,
1010
COALESCE(SUM(tup_updated)::BIGINT, 0) AS update,
1111
COALESCE(SUM(tup_deleted)::BIGINT, 0) AS delete,
12-
COALESCE(SUM(tup_returned)::BIGINT, 0) AS tuples_returned,
1312
COALESCE(CASE
1413
WHEN %(skip_db_size)s THEN %(prev_total_size)s
1514
ELSE SUM(pg_database_size(d.datname))

0 commit comments

Comments
 (0)