Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [pg-stat-activity]

pg_stat_activity is a PostgreSQL table that contains statistics about running queries in the DBMS.

Filter by
Sorted by
Tagged with
-1 votes
1 answer

Best resolution for NULL connections?

my_database_name> SELECT pid, datname, usename, application_name, query_start, state, state_change FROM pg_stat_activity; +-------+------------------+------------------+--------------------------+--...
Sahil Shaikh's user avatar
1 vote
0 answers

How to list query which used an index while selecting result in Postgres?

I know that Postgres has some utility extensions that collect stats for statements and indexes. I want to list queries which used particular index, whichselectsg the result. Is there a way to get that ...
Santosh Hegde's user avatar
2 votes
1 answer

Why is pg_stat_activity.query_start null for almost all queries? [closed]

Why is pg_stat_activity.query_start null for almost all queries? What is the meaning of a NULL query_start field?
Josh's user avatar
  • 171
0 votes
1 answer

What does pg_stat_activity.xact_start mean for autovacuum threads?

If I see something like: db=> SELECT datname,pid,state, (now() - query_start)::interval, query FROM pg_stat_activity where state != 'idle' and query like 'autovacuum%'; datname | pid | state | ...
jberryman's user avatar
  • 471
2 votes
1 answer

pg_stat_statements causing DB to run out of memory

I enabled pg_stat_statements on an AWS RDS postgres 9.6.3 instance with 30GB RAM. We got the error message below in postgres log, and an event saying OS killed DB server process due to excessive ...
virtual void's user avatar
5 votes
1 answer

PostgreSQL: Run EXPLAIN on all queries in pg_stat_activity

I am investigating high load on a PostgreSQL database on RDS. As a part of the investigation, I'm running the following query: SELECT now()-query_start, state, query FROM pg_stat_activity ORDER BY 1 ...
Adam Matan's user avatar
  • 11.7k
0 votes
2 answers

pg_stat_activity entries with no corresponding process on the client

If I see an entry in pg_stat_activity for a client_addr:client_port combination where there is no process bound to that port on the indicated client, what does that mean? Just that the client process ...
gcbenison's user avatar
  • 135