[16Beta1][doc] pgstat: Track time of the last scan of a relation
Hi, hackers.
PostgreSQL 16 Beta1, added last access time to pg_stat_all_tables and pg_stat_all_indexes views by this patch [1]pgstat: Track time of the last scan of a relation https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=c037471832e1ec3327f81eebbd8892e5c1042fe0.
According to the documentation [2]pg_stat_activity view https://www.postgresql.org/docs/16/monitoring-stats.html#MONITORING-PG-STAT-ALL-TABLES-VIEW, the data type of the columns added to these views is 'timestamptz'.
However, columns of the same data type in pg_stat_all_tables.last_vacuum, last_analyze and other tables are unified to 'timestamp with time zone'. The attached patch changes the data type of the added column from timestamptz to timestamp with time zone.
[1]: pgstat: Track time of the last scan of a relation https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=c037471832e1ec3327f81eebbd8892e5c1042fe0
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=c037471832e1ec3327f81eebbd8892e5c1042fe0
[2]: pg_stat_activity view https://www.postgresql.org/docs/16/monitoring-stats.html#MONITORING-PG-STAT-ALL-TABLES-VIEW
https://www.postgresql.org/docs/16/monitoring-stats.html#MONITORING-PG-STAT-ALL-TABLES-VIEW
Regards,
Noriyoshi Shinoda
Attachments:
pg_stat_all_tables_doc_v1.diffapplication/octet-stream; name=pg_stat_all_tables_doc_v1.diffDownload
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 40ad419194..5cfdc70c03 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -4863,7 +4863,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>last_seq_scan</structfield> <type>timestamptz</type>
+ <structfield>last_seq_scan</structfield> <type>timestamp with time zone</type>
</para>
<para>
The time of the last sequential scan on this table, based on the
@@ -4891,7 +4891,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>last_idx_scan</structfield> <type>timestamptz</type>
+ <structfield>last_idx_scan</structfield> <type>timestamp with time zone</type>
</para>
<para>
The time of the last index scan on this table, based on the
@@ -5170,7 +5170,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>last_idx_scan</structfield> <type>timestamptz</type>
+ <structfield>last_idx_scan</structfield> <type>timestamp with time zone</type>
</para>
<para>
The time of the last scan on this index, based on the
On Wed, 31 May 2023 at 15:57, Shinoda, Noriyoshi (PN Japan FSIP)
<noriyoshi.shinoda@hpe.com> wrote:
According to the documentation [2], the data type of the columns added to these views is 'timestamptz'.
However, columns of the same data type in pg_stat_all_tables.last_vacuum, last_analyze and other tables are unified to 'timestamp with time zone'. The attached patch changes the data type of the added column from timestamptz to timestamp with time zone.
I agree that it would be good to make those consistently use timestamp
with time zone for all columns of that type in the docs for
pg_stat_all_tables.
More generally, it might be good if we did it for the entire docs:
doc $ git grep "<type>timestamptz</type>" | wc -l
17
doc $ git grep "<type>timestamp with time zone</type>" | wc -l
74
Clearly "timestamp with time zone" is much more commonly used.
The bar is probably set a bit higher for changing the
longer-established ones, however.
David
Hi, Thanks for your comment.
As you say, it would be difficult to unify the data types in all documents right now.
The patch I attached the other day unifies only the newly added columns in monitoring.sgml to "timestamp with time zone".
Regards,
Noriyoshi Shinoda
-----Original Message-----
From: David Rowley <dgrowleyml@gmail.com>
Sent: Wednesday, May 31, 2023 3:14 PM
To: Shinoda, Noriyoshi (PN Japan FSIP) <noriyoshi.shinoda@hpe.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>; dpage@pgadmin.org; andres@anarazel.de; bruce@momjian.us; vik@postgresfriends.org
Subject: Re: [16Beta1][doc] pgstat: Track time of the last scan of a relation
On Wed, 31 May 2023 at 15:57, Shinoda, Noriyoshi (PN Japan FSIP) <noriyoshi.shinoda@hpe.com> wrote:
According to the documentation [2], the data type of the columns added to these views is 'timestamptz'.
However, columns of the same data type in pg_stat_all_tables.last_vacuum, last_analyze and other tables are unified to 'timestamp with time zone'. The attached patch changes the data type of the added column from timestamptz to timestamp with time zone.
I agree that it would be good to make those consistently use timestamp with time zone for all columns of that type in the docs for pg_stat_all_tables.
More generally, it might be good if we did it for the entire docs:
doc $ git grep "<type>timestamptz</type>" | wc -l
17
doc $ git grep "<type>timestamp with time zone</type>" | wc -l
74
Clearly "timestamp with time zone" is much more commonly used.
The bar is probably set a bit higher for changing the longer-established ones, however.
David
On Wed, 31 May 2023 at 15:57, Shinoda, Noriyoshi (PN Japan FSIP)
<noriyoshi.shinoda@hpe.com> wrote:
PostgreSQL 16 Beta1, added last access time to pg_stat_all_tables and pg_stat_all_indexes views by this patch [1].
According to the documentation [2], the data type of the columns added to these views is 'timestamptz'.
However, columns of the same data type in pg_stat_all_tables.last_vacuum, last_analyze and other tables are unified to 'timestamp with time zone'. The attached patch changes the data type of the added column from timestamptz to timestamp with time zone.
I've now pushed this change.
David
Hi, David.
I've now pushed this change.
Thank you so much.
-----Original Message-----
From: David Rowley <dgrowleyml@gmail.com>
Sent: Monday, June 5, 2023 2:37 PM
To: Shinoda, Noriyoshi (PN Japan FSIP) <noriyoshi.shinoda@hpe.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>; dpage@pgadmin.org; andres@anarazel.de; bruce@momjian.us; vik@postgresfriends.org
Subject: Re: [16Beta1][doc] pgstat: Track time of the last scan of a relation
On Wed, 31 May 2023 at 15:57, Shinoda, Noriyoshi (PN Japan FSIP) <noriyoshi.shinoda@hpe.com> wrote:
PostgreSQL 16 Beta1, added last access time to pg_stat_all_tables and pg_stat_all_indexes views by this patch [1].
According to the documentation [2], the data type of the columns added to these views is 'timestamptz'.
However, columns of the same data type in pg_stat_all_tables.last_vacuum, last_analyze and other tables are unified to 'timestamp with time zone'. The attached patch changes the data type of the added column from timestamptz to timestamp with time zone.
I've now pushed this change.
David