From c7f0b85ba1e70475955ae84dbcb5c0c42e03de91 Mon Sep 17 00:00:00 2001 From: Ozan Onur TEK Date: Wed, 25 Feb 2026 07:39:07 +0300 Subject: [PATCH] perf: Add PostgreSQL indexes for ~15x performance improvement (#1541) fix: missing indexes are added to improve postgresql performance Co-authored-by: TwiN --- storage/store/sql/specific_postgres.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage/store/sql/specific_postgres.go b/storage/store/sql/specific_postgres.go index b895564d..5e20ab0b 100644 --- a/storage/store/sql/specific_postgres.go +++ b/storage/store/sql/specific_postgres.go @@ -120,5 +120,9 @@ func (s *Store) createPostgresSchema() error { _, _ = s.db.Exec(`ALTER TABLE endpoint_results ADD COLUMN IF NOT EXISTS suite_result_id BIGINT REFERENCES suite_results(suite_result_id) ON DELETE CASCADE`) // Create index for suite_result_id _, _ = s.db.Exec(`CREATE INDEX IF NOT EXISTS endpoint_results_suite_result_id_idx ON endpoint_results(suite_result_id)`) + // Create index for endpoint_result_conditions + _, _ = s.db.Exec(`CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_endpoint_result_conditions_endpoint_result_id ON endpoint_result_conditions (endpoint_result_id)`) + // Create index for endpoint_results + _, _ = s.db.Exec(`CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_endpoint_results_endpoint_id ON endpoint_results (endpoint_id)`) return err }