Skip to content

Commit 07f0bc5

Browse files
authored
Merge pull request #120906 from soenkehack/patch-1
Fix query to get the last_analyze value
2 parents e7362e3 + c89d23b commit 07f0bc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

articles/postgresql/flexible-server/how-to-autovacuum-tuning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Use the following query to list the tables in a database and identify the tables
9898
,C.reltuples AS reltuples
9999
,round(current_setting('autovacuum_vacuum_threshold')::INTEGER + current_setting('autovacuum_vacuum_scale_factor')::NUMERIC * C.reltuples) AS av_threshold
100100
,date_trunc('minute', greatest(pg_stat_get_last_vacuum_time(C.oid), pg_stat_get_last_autovacuum_time(C.oid))) AS last_vacuum
101-
,date_trunc('minute', greatest(pg_stat_get_last_analyze_time(C.oid), pg_stat_get_last_analyze_time(C.oid))) AS last_analyze
101+
,date_trunc('minute', greatest(pg_stat_get_last_analyze_time(C.oid), pg_stat_get_last_autoanalyze_time(C.oid))) AS last_analyze
102102
FROM pg_class C
103103
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
104104
WHERE C.relkind IN (

0 commit comments

Comments
 (0)