Re: Selects query stats?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Selects query stats?
Дата
Msg-id 20060523195001.GH28863@surnet.cl
обсуждение исходный текст
Ответ на Re: Selects query stats?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Selects query stats?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Selects query stats?  ("Jim C. Nasby" <jnasby@pervasive.com>)
Re: Selects query stats?  (Mischa Sandberg <mischa@ca.sophos.com>)
Список pgsql-performance
Tom Lane wrote:

> Counting individual statements would add overhead (which the OP already
> declared unacceptable) and there are some definitional issues too, like
> whether to count statements executed within functions.

Yeah, the problem seems underspecified.  How do you count statements
added or removed by rewrite rules?  Statements executed to answer RI
queries?  Do you count the statements issued by clients as part of the
startup sequence?  The hypothetical "reset session" of a connection pool
handler?  How do you count 2PC -- when they are executed, or when they
are committed?  What happens to statements in transactions that are
rolled back?  What happens to a statement that is executed partially
because it failed partway (e.g. because of division by zero)?


OTOH ISTM it would be easy to modify Postgres so as to count statements
in the stat collector, by turning pgstat_report_activity into a routine
that sent a count (presumably always 1) instead of the query string, and
then just add the count to a counter on receiving.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Selects query stats?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Selects query stats?