summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-08-10 14:02:11 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-08-10 14:02:11 +0000
commit95091ac86c89cf4e5dc7d79a1f518fc655ed11eb (patch)
treed233966754788acbc46b172164292bdedc2dc657 /include
parentdaad3ceb2e48d4c8531281f8ca0c6d867199f6e6 (diff)
Improvements for housekeeping procedure.
git-svn-id: svn://svn.zabbix.com/trunk@889 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'include')
-rw-r--r--include/db.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/db.c b/include/db.c
index 1894ba9e..c8698c19 100644
--- a/include/db.c
+++ b/include/db.c
@@ -828,13 +828,28 @@ int DBadd_alert(int actionid, int mediatypeid, char *sendto, char *subject, char
void DBvacuum(void)
{
+
#ifdef HAVE_PGSQL
+ char *table_for_housekeeping[]={ "services", "services_links", "graphs_items", "graphs", "sysmaps_links",
+ "sysmaps_hosts", "sysmaps", "config", "groups", "hosts_groups", "alerts",
+ "actions", "alarms", "functions", "history", "history_str", "hosts",
+ "items", "media", "media_type", "triggers", "trigger_depends", "users",
+ "sessions", "rights", "service_alarms", "profiles", "screens", "screens_items",
+ "screens_graphs", "stats",
+ NULL};
+
char sql[MAX_STRING_LEN+1];
+ char *table;
+ int i;
#ifdef HAVE_FUNCTION_SETPROCTITLE
setproctitle("housekeeper [vacuum DB]");
#endif
- sprintf(sql,"vacuum analyze");
- DBexecute(sql);
+ i=0;
+ while (NULL != (table = table_for_housekeeping[i++]))
+ {
+ sprintf(sql,"vacuum analyze %s", table);
+ DBexecute(sql);
+ }
#endif
#ifdef HAVE_MYSQL