- Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathqueries.sql
18 lines (13 loc) · 720 Bytes
/
queries.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
CREATE EXTENSION pg_wait_sampling;
WITH t as (SELECTsum(0) FROM pg_wait_sampling_current)
SELECTsum(0) FROM generate_series(1, 2), t;
WITH t as (SELECTsum(0) FROM pg_wait_sampling_history)
SELECTsum(0) FROM generate_series(1, 2), t;
WITH t as (SELECTsum(0) FROM pg_wait_sampling_profile)
SELECTsum(0) FROM generate_series(1, 2), t;
-- Some dummy checks just to be sure that all our functions work and return something.
SELECTcount(*) =1as test FROM pg_wait_sampling_get_current(pg_backend_pid());
SELECTcount(*) >=0as test FROM pg_wait_sampling_get_profile();
SELECTcount(*) >=0as test FROM pg_wait_sampling_get_history();
SELECT pg_wait_sampling_reset_profile();
DROP EXTENSION pg_wait_sampling;