@cryptotaxi247 / netdata-1 / commits / 02a418c51

Cleanup chart hash and map tables on startup (#12956)

Stelios Fragkakis committed May 19, 2022 at 19:55 UTC 02a418c515afdcafab5512790867aafb366a73a6
1 file changed +2
database/sqlite/sqlite_functions.c
+2
@@ -60,6 +60,8 @@ const char *database_cleanup[] = {
60 "delete from chart where chart_id not in (select chart_id from dimension);",
61 "delete from host where host_id not in (select host_id from chart);",
62 "delete from chart_label where chart_id not in (select chart_id from chart);",
63 + "DELETE FROM chart_hash_map WHERE chart_id NOT IN (SELECT chart_id FROM chart);",
64 + "DELETE FROM chart_hash WHERE hash_id NOT IN (SELECT hash_id FROM chart_hash_map);",
65 "DELETE FROM node_instance WHERE host_id NOT IN (SELECT host_id FROM host);",
66 NULL
67 };