Re: [UPDATED] A GUC variable to replace PGBE_ACTIVITY_SIZE

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Thomas Lee" <tom(at)vector-seven(dot)com>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [UPDATED] A GUC variable to replace PGBE_ACTIVITY_SIZE
Date: 2008-06-30 10:59:28
Message-ID: 4868BC90.2080209@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2008-06-30 15:22:00 Re: [UPDATED] A GUC variable to replace PGBE_ACTIVITY_SIZE
Previous Message Peter Eisentraut 2008-06-28 20:52:34 Re: Removal of the patches email list