summaryrefslogtreecommitdiff
path: root/src/include/pgstat.h
diff options
context:
space:
mode:
authorHeikki Linnakangas2008-06-30 10:58:47 +0000
committerHeikki Linnakangas2008-06-30 10:58:47 +0000
commit995fb7420268c2457c9a64f41394cea54316365f (patch)
treed8de58e9497f15da810d19c71a18f8fe6692b060 /src/include/pgstat.h
parent7ea9b997ef07672d45278ab1c5b0634eaa090966 (diff)
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.
Diffstat (limited to 'src/include/pgstat.h')
-rw-r--r--src/include/pgstat.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index 9b48f42bb0..fabc5fb4a0 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -5,7 +5,7 @@
*
* Copyright (c) 2001-2008, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.76 2008/06/19 00:46:05 alvherre Exp $
+ * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.77 2008/06/30 10:58:47 heikki Exp $
* ----------
*/
#ifndef PGSTAT_H
@@ -509,9 +509,6 @@ typedef struct PgStat_GlobalStats
* ----------
*/
-/* Max length of st_activity string ... perhaps replace with a GUC var? */
-#define PGBE_ACTIVITY_SIZE 1024
-
/* ----------
* PgBackendStatus
*
@@ -551,7 +548,7 @@ typedef struct PgBackendStatus
bool st_waiting;
/* current command string; MUST be null-terminated */
- char st_activity[PGBE_ACTIVITY_SIZE];
+ char *st_activity;
} PgBackendStatus;
/*
@@ -578,6 +575,7 @@ typedef struct PgStat_FunctionCallUsage
extern bool pgstat_track_activities;
extern bool pgstat_track_counts;
extern int pgstat_track_functions;
+extern int pgstat_track_activity_query_size;
/*
* BgWriter statistics counters are updated directly by bgwriter and bufmgr