Re: [UPDATED] A GUC variable to replace PGBE_ACTIVITY_SIZE

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: [UPDATED] A GUC variable to replace PGBE_ACTIVITY_SIZE
Дата
Msg-id 4868BC90.2080209@enterprisedb.com
обсуждение исходный текст
Ответ на Re: [UPDATED] A GUC variable to replace PGBE_ACTIVITY_SIZE  (Thomas Lee <tom@vector-seven.com>)
Ответы Re: [UPDATED] A GUC variable to replace PGBE_ACTIVITY_SIZE
Список pgsql-patches
Thomas Lee wrote:
> An updated patch for the track_activity_query_size GUC variable.

Thanks, committed with some changes.

There was one bug: BackendStatusShmemSize() needs to report the memory
needed for the activity string buffers; it's used for sizing the single
fixed size shmem block on postmaster startup. I also fixed the
documentation to refer to the setting with the right name, noted that
it's a startup time option, and changed the wording a bit.

I tested the performance between strcpy and memcpy a little bit. As
expected, strcpy is a lot cheaper if the string is small. I chose
strcpy, since it's very likely that the buffer is over-sized, and even
if it's just the right size to hold typical queries, it's going to be
"<IDLE>" for idle connections.

Another simple optimization occurred to me while looking at this: we
should skip the memcpy/strcpy altogether if the BackendActivity slot is
not in use. That seems like a good bet, you usually don't try to max out
max_connections.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

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

Предыдущее
От: Tom Raney
Дата:
Сообщение: Re: Explain XML patch
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [UPDATED] A GUC variable to replace PGBE_ACTIVITY_SIZE