From 8115484f322edfea87e901b832e226bdbc47c877 Mon Sep 17 00:00:00 2001 From: "stonezdj(Daojun Zhang)" Date: Mon, 4 Jul 2022 14:38:05 +0800 Subject: [PATCH] Create index for performance (#17022) Add index to avoid full table scan Signed-off-by: stonezdj --- make/migrations/postgresql/0090_2.6.0_schema.up.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/make/migrations/postgresql/0090_2.6.0_schema.up.sql b/make/migrations/postgresql/0090_2.6.0_schema.up.sql index e24669fc3..a3b23dd66 100644 --- a/make/migrations/postgresql/0090_2.6.0_schema.up.sql +++ b/make/migrations/postgresql/0090_2.6.0_schema.up.sql @@ -17,4 +17,8 @@ Github proposal link : https://github.com/goharbor/community/pull/181 UNIQUE ("repository", "digest", "vendor") ); -CREATE INDEX IF NOT EXISTS idx_artifact_repository_name ON artifact (repository_name); \ No newline at end of file +CREATE INDEX IF NOT EXISTS idx_artifact_repository_name ON artifact (repository_name); + +CREATE INDEX IF NOT EXISTS idx_execution_vendor_type_vendor_id ON execution (vendor_type, vendor_id); +CREATE INDEX IF NOT EXISTS idx_execution_start_time ON execution(start_time); +CREATE INDEX IF NOT EXISTS idx_audit_log_project_id_optime ON audit_log (project_id, op_time);