@cryptotaxi247 / netdata-1 / commits / 8e8531d40

Create index for health log migration (#15233)

Create health_log_id index

Stelios Fragkakis committed Jun 22, 2023 at 00:14 UTC 8e8531d402b4038c12dfb73431559082787ebaa8
2 files changed +3
database/sqlite/sqlite_db_migration.c
+2
@@ -244,6 +244,8 @@ static int do_migration_v8_v9(sqlite3 *database, const char *name)
244 sqlite3_exec_monitored(database, sql, 0, 0, NULL);
245 snprintfz(sql, 2047, "CREATE INDEX IF NOT EXISTS health_log_d_ind_3 ON health_log_detail (transition_id);");
246 sqlite3_exec_monitored(database, sql, 0, 0, NULL);
247 + snprintfz(sql, 2047, "CREATE INDEX IF NOT EXISTS health_log_d_ind_4 ON health_log_detail (health_log_id);");
248 + sqlite3_exec_monitored(database, sql, 0, 0, NULL);
249
250 snprintfz(sql, 2047, "ALTER TABLE alert_hash ADD source text;");
251 sqlite3_exec_monitored(database, sql, 0, 0, NULL);
database/sqlite/sqlite_functions.c
+1
@@ -61,6 +61,7 @@ const char *database_config[] = {
61 "CREATE INDEX IF NOT EXISTS health_log_d_ind_1 ON health_log_detail (unique_id);",
62 "CREATE INDEX IF NOT EXISTS health_log_d_ind_2 ON health_log_detail (global_id);",
63 "CREATE INDEX IF NOT EXISTS health_log_d_ind_3 ON health_log_detail (transition_id);",
64 + "CREATE INDEX IF NOT EXISTS health_log_d_ind_4 ON health_log_detail (health_log_id);",
65 //TODO more indexes
66
67 NULL