Re: Add min and max execute statement time in pg_stat_statement

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Add min and max execute statement time in pg_stat_statement
Дата
Msg-id 9084.1382396992@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Add min and max execute statement time in pg_stat_statement  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Yeah, and I worry about min and max not being very usable - once they
> get pushed out to extreme values, there's nothing to drag them back
> toward normality except resetting the stats, and that's not something
> we want to encourage people to do frequently. Of course, averages over
> very long sampling intervals may not be too useful anyway, dunno.

Good point, but that doesn't mean that the request is unreasonable.

For min/max, we could possibly address this concern by introducing an
exponential decay over time --- that is, every so often, you take some
small fraction of (max - min) and add that to the running min while
subtracting it from the max.  Or some other variant on that theme.  There
might be a way to progressively discount old observations for average too,
though I'm not sure exactly how at the moment.
        regards, tom lane



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Add min and max execute statement time in pg_stat_statement
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Add min and max execute statement time in pg_stat_statement