Re: Displaying current query - eliminating <IDLE>

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rieback Melanie <melanie(at)cs(dot)vu(dot)nl>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Displaying current query - eliminating <IDLE>
Date: 2005-10-22 02:58:45
Message-ID: 27666.1129949925@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Rieback Melanie <melanie(at)cs(dot)vu(dot)nl> writes:
> To see the current query in PostgreSQL, the normal procedure is to type:
> SELECT current_query FROM pg_stat_activity;

> Now here's my question.. I want PostgreSQL to react sufficiently
> quickly that the result says:
> SELECT current_query FROM pg_stat_activity;

Sorry, there's basically 0 chance of that happening with any
reliability. The stats system is designed not to slow down actual
transactions at all, which is what it would have to do to guarantee
instantaneous response.

You could improve the reaction time by reducing PGSTAT_STAT_INTERVAL
in the source code (see backend/postmaster/pgstat.c), but you'll incur
corresponding increases in overhead, and you'll never get to the point
of certain repeatability.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Rieback Melanie 2005-10-22 06:39:04 Re: Displaying current query - eliminating <IDLE>
Previous Message Michael Glaesemann 2005-10-21 22:37:09 Re: Database design advice