query execution time for last 24 hours in PostgreSQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Team,

Can you please let me know anyone how to get each query execution time from last 24 hours in PostgreSQL 

I tried the below query but giving the wrong information.

SELECT sa.client_addr,
sa.usename,
sa.datname,
sa.state,
sa.query,
sa.query_start,
EXTRACT (EPOCH FROM (current_timestamp sa.query_start)) AS execution_time_seconds
FROM pg_stat_activity sa
WHERE sa.query_start >= current_timestamp interval '24 hours';

Thanks,
Nikhil,
PostgreSQL DBA,
8074430856.

[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux