mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Turn PGBE_ACTIVITY_SIZE into a GUC variable, track_activity_query_size.
As the buffer could now be a lot larger than before, and copying it could thus be a lot more expensive than before, use strcpy instead of memcpy to copy the query string, as was already suggested in comments. Also, only copy the PgBackendStatus struct and string if the slot is in use. Patch by Thomas Lee, with some changes by me.
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.456 2008/05/28 09:04:06 mha Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.457 2008/06/30 10:58:47 heikki Exp $
|
||||
*
|
||||
*--------------------------------------------------------------------
|
||||
*/
|
||||
@ -1848,6 +1848,15 @@ static struct config_int ConfigureNamesInt[] =
|
||||
-1, -1, INT_MAX, NULL, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"track_activity_query_size", PGC_POSTMASTER, RESOURCES_MEM,
|
||||
gettext_noop("Sets the size reserved for pg_stat_activity.current_query, in bytes."),
|
||||
NULL,
|
||||
},
|
||||
&pgstat_track_activity_query_size,
|
||||
1024, 100, 102400, NULL, NULL
|
||||
},
|
||||
|
||||
/* End-of-list marker */
|
||||
{
|
||||
{NULL, 0, 0, NULL, NULL}, NULL, 0, 0, 0, NULL, NULL
|
||||
|
Reference in New Issue
Block a user