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

Sent via pgsql-patches mailing list (
To make changes to your subscription:

Reply via email to