From cce83f83cd3a947050aaf7ef131a9ef18ea0700d Mon Sep 17 00:00:00 2001 From: Stephanya Casanova Date: Thu, 17 Oct 2024 15:04:21 +0200 Subject: [PATCH] [backend] Add index for expectations on inject --- .../V3_45__Add_indexes_scenario_exercise_latency.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openbas-api/src/main/java/io/openbas/migration/V3_45__Add_indexes_scenario_exercise_latency.java b/openbas-api/src/main/java/io/openbas/migration/V3_45__Add_indexes_scenario_exercise_latency.java index 2821553dd2..5fd7f0619d 100644 --- a/openbas-api/src/main/java/io/openbas/migration/V3_45__Add_indexes_scenario_exercise_latency.java +++ b/openbas-api/src/main/java/io/openbas/migration/V3_45__Add_indexes_scenario_exercise_latency.java @@ -14,5 +14,10 @@ public void migrate(Context context) throws Exception { Connection connection = context.getConnection(); Statement select = connection.createStatement(); select.execute("CREATE INDEX IF NOT EXISTS idx_inject_expectation_inject_id ON injects_expectations(inject_id);"); + select.execute("CREATE INDEX IF NOT EXISTS idx_inject_expectation_team_id ON injects_expectations(team_id);"); + select.execute("CREATE INDEX IF NOT EXISTS idx_inject_expectation_user_id ON injects_expectations(user_id);"); + select.execute("CREATE INDEX IF NOT EXISTS idx_inject_expectation_asset_group_id ON injects_expectations(asset_group_id);"); + select.execute("CREATE INDEX IF NOT EXISTS idx_inject_expectation_asset_id ON injects_expectations(asset_id);"); + select.execute("CREATE INDEX IF NOT EXISTS idx_inject_expectation_exercise_id ON injects_expectations(exercise_id);"); } }