Re: Query stucked in pg_stat_activity

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
Cc: Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Query stucked in pg_stat_activity
Date: 2005-08-09 15:24:23
Message-ID: 16374.1123601063@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Csaba Nagy <nagy(at)ecircle-ag(dot)com> writes:
> On our first test run everything went fine, the only strange thing is a
> row in the pg_stat_activity, which has a row about a query which is long
> gone, the process pointed by the procpid field is not existing.

This is not totally surprising, since the pgstat mechanism is by design
not 100% reliable (it will drop statistics messages under high load
rather than making backends wait for the stats collector). Probably the
backend-is-exiting message for that process got dropped.

Eventually that backend slot will get re-used for another backend, and
then the entry will go away, but if it's a high-number slot then it'll
take a similar load level to get to it.

> I've executed a "select pg_stat_reset();" as superuser, and all went
> away except the offending row...

That only resets the I/O counts (and only for one database), not the
backend activity info.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Csaba Nagy 2005-08-09 15:29:10 Re: Query stucked in pg_stat_activity
Previous Message Tom Lane 2005-08-09 15:18:09 Re: Referencing "less-unique" foreign keys