File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,12 @@ class Oldest(Plugin):
19
19
OldestQuerySql = """
20
20
select
21
21
extract(epoch from max(now() - xact_start))
22
- from pg_catalog.pg_stat_activity where pid not in (select pid from pg_stat_replication);
22
+ from pg_catalog.pg_stat_activity
23
+ where
24
+ pid not in (select pid from pg_stat_replication)
25
+ AND pid <> pg_backend_pid()
26
+ AND query not ilike '%VACUUM%'
27
+ HAVING extract(epoch from max(now() - xact_start))>0;
23
28
"""
24
29
25
30
OldestQuerySql_bootstrap = """
Original file line number Diff line number Diff line change 70
70
SELECT
71
71
extract(epoch from max(now() - xact_start))
72
72
FROM pg_catalog.pg_stat_activity
73
- WHERE pid not in (select pid from pg_stat_replication)
73
+ WHERE
74
+ pid not in (select pid from pg_stat_replication)
75
+ AND pid <> pg_backend_pid()
76
+ AND query not ilike '%VACUUM%'
77
+ HAVING extract(epoch from max(now() - xact_start))>0
74
78
$$ LANGUAGE SQL SECURITY DEFINER;
75
79
76
80
CREATE OR REPLACE FUNCTION public.mamonsu_count_{3}_files()
You can’t perform that action at this time.
0 commit comments