Chakravarthi Ayyala
asked on
What is Oracle's v$session_longops equivalent in Postgres?
Trying to understand if there is an equivalent pg view in Postgres, which is similar to v$session_longops in Oracle.
That query will show you how long a query has been running.
I'm not sure Postgres has the other information contained in v$session_longops. Definitely have never seen anything like TIME_REMAINING in Postgres.
Some of the other columns might be obtained from other queries.
I'm not sure Postgres has the other information contained in v$session_longops. Definitely have never seen anything like TIME_REMAINING in Postgres.
Some of the other columns might be obtained from other queries.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can find long running queries in postgres by running a script like belor:
Open in new window
where you can change the << '5 >> minutes interval to whatever you wish like << "10 >> for 10seconds etc...
https://www.shanelynn.ie/postgresql-find-slow-long-running-and-blocked-queries/
The query below should give a list with all executing/running queries including their runtime:
Open in new window