You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using the --sink=postgres://postgres the stat_statements table is empty, and not getting populated.
While trying to use this Query as perdefined in the SHOW SQL Querie Dashboard..
total_time, mean_time, calls as total_calls, seconds_since_last_exec, queryid, query
FROM (
SELECT
DISTINCT ON (queryid) queryid, time, total_time, mean_time, calls, query
FROM (
SELECT
time, (data->>'total_time')::float as total_time, (data->>'total_time')::float / (data->>'calls')::int8 as mean_time, (data->>'calls')::int8 as calls, tag_data->>'queryid' as queryid, tag_data->>'query' as query
FROM stat_statements
WHERE
dbname = '$dbname'
AND time > now() - '$calls_interval'::interval
AND tag_data->>'query' ~* '$sql_fragment'
AND CASE WHEN length('$sql_fragment') > 2 THEN true ELSE false END
) x
ORDER BY queryid, time DESC, mean_time, calls, query
) y
JOIN LATERAL
(select (extract(epoch from now() - prev.time))::int8 as seconds_since_last_exec
from stat_statements prev
where dbname = '$dbname' and time > now() - '$calls_interval'::interval
and prev.time < y.time and (prev.data->>'calls')::int8 != y.calls
order by time desc limit 1
) z on true
ORDER BY total_time DESC LIMIT 100`
Currently trying to Monitor RDS Instances.
SELECT * FROM pg_available_extensions WHERE name = 'pg_stat_statements' ;
"pg_stat_statements" "1.9" "1.9" "track planning and execution statistics of all SQL statements executed"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
using the --sink=postgres://postgres the stat_statements table is empty, and not getting populated.
While trying to use this Query as perdefined in the SHOW SQL Querie Dashboard..
Currently trying to Monitor RDS Instances.
Source.yaml
Should preset_metrics: be set to rds
Beta Was this translation helpful? Give feedback.
All reactions