Selasa, 23 Juli 2024

Rangkuman Query PostgreSQL

Check Max Connection
SHOW max_connections;
Query menampilkan total connection, active connection, idle connection, dan max connection di database postgresql
SELECT 
    count(*) AS total_connections,
    count(*) FILTER (WHERE state = 'active') AS active_connections,
    count(*) FILTER (WHERE state = 'idle') AS idle_connections,
    (SELECT setting::int FROM pg_settings WHERE name = 'max_connections') AS max_connections
FROM pg_stat_activity;

asdas
Load disqus comments

0 komentar