Re: Displaying current query - eliminating - Mailing list pgsql-novice

From Tom Lane
Subject Re: Displaying current query - eliminating
Date
Msg-id 27666.1129949925@sss.pgh.pa.us
Whole thread Raw
In response to Displaying current query - eliminating  (Rieback Melanie <melanie@cs.vu.nl>)
Responses Re: Displaying current query - eliminating  (Rieback Melanie <melanie@cs.vu.nl>)
List pgsql-novice
Rieback Melanie <melanie@cs.vu.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

pgsql-novice by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: Database design advice
Next
From: Rieback Melanie
Date:
Subject: Re: Displaying current query - eliminating