Create index for performance (#17022)

Add index to avoid full table scan
Signed-off-by: stonezdj <stonezdj@gmail.com>
This commit is contained in:
stonezdj(Daojun Zhang) 2022-07-04 14:38:05 +08:00 committed by GitHub
parent 315d8a8993
commit 8115484f32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,3 +18,7 @@ Github proposal link : https://github.com/goharbor/community/pull/181
);
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);