Skip site navigation (1) Skip section navigation (2)

Re: Displaying current query - eliminating <IDLE>

From: Rieback Melanie <melanie(at)cs(dot)vu(dot)nl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Displaying current query - eliminating <IDLE>
Date: 2005-10-22 06:39:04
Message-ID: Pine.GSO.4.56.0510220825210.20875@flits.few.vu.nl (view raw or flat)
Thread:
Lists: pgsql-novice
Thanks for your response!

> 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.
Is there a way that I can manually slow down a query or transaction, to
ensure that I see it when I type 'SELECT current_query FROM
pg_stat_activity;'.  I already tried explicitly ending transactions by
typing:

BEGIN; SELECT current_query FROM pg_stat_activity; COMMIT;

and

BEGIN; COMMIT; SELECT current_query FROM pg_stat_activity;

but that didn't seem to help.  Is there a kindof sleep command that I can
use to turn this particular query into a 'long' query, that will register
instantaneously as the current_query? (This is assuming that the database
is relatively empty, so I can't create a normal query that will take that
long).

> You could improve the reaction time by reducing PGSTAT_STAT_INTERVAL
> in the source code (see backend/postmaster/pgstat.c),
Would this have a different effect than typing:
\set pgstat_stat_interval 0
at the command prompt in the pgSQL client itself?

> but you'll incur corresponding increases in overhead, and you'll never
> get to the point of certain repeatability.
I don't care at all about increases in overhead.  I warned you that my
request is a strange one, but this is more of a puzzle, that happens to
have a real use for me.  It also doesn't have to be 100% repeatable.  50%
or even 25% repeatable would be good enough for me, as long as it works a
significant percentage of the time.

Thanks again!

Melanie


In response to

pgsql-novice by date

Next:From: operationsengineer1Date: 2005-10-22 19:25:36
Subject: Excellent PGSQL Tutorial, WinXP as Service - Configure for Manual Operation
Previous:From: Tom LaneDate: 2005-10-22 02:58:45
Subject: Re: Displaying current query - eliminating <IDLE>

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group