Fix initialization of pg_stat_get_lastscan()
Michael Paquier <michael@paquier.xyz>
Fix initialization of pg_stat_get_lastscan() A NULL result should be reported when a stats timestamp is set to 0, but c037471 missed that, leading to a confusing timestamp value after for example a DML on a freshly-created relation with no scans done on it yet. This impacted the following attributes for two system views: - pg_stat_all_tables.last_idx_scan - pg_stat_all_tables.last_seq_scan - pg_stat_all_indexes.last_idx_scan Reported-by: Robert Treat Analyzed-by: Peter Eisentraut Author: Dave Page Discussion: https://postgr.es/m/CABV9wwPzMfSaz3EfKXXDxKmMprbxwF5r6WPuxqA=5mzRUqfTGg@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/pgstatfuncs.c | modified | +7 −1 |
| src/test/regress/expected/stats.out | modified | +6 −0 |
| src/test/regress/sql/stats.sql | modified | +1 −0 |
Discussion
- Tracking last scan time 43 messages · 2022-08-23 → 2022-11-08