Re: Displaying current query - eliminating

Поиск
Список
Период
Сортировка
От Rieback Melanie
Тема Re: Displaying current query - eliminating
Дата
Msg-id Pine.GSO.4.56.0510220825210.20875@flits.few.vu.nl
обсуждение исходный текст
Ответ на Re: Displaying current query - eliminating  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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


В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Displaying current query - eliminating
Следующее
От:
Дата:
Сообщение: Excellent PGSQL Tutorial, WinXP as Service - Configure for Manual Operation