harbor/make/migrations/postgresql/0060_2.3.0_schema.up.sql
Wenkai Yin dc059a9a8f Improve the performance of artifact related APIs
Improve the performance of artifact related APIs by adding indexes and refactoring sql logic

Closes #13890 #14813 #14814

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2021-05-20 11:25:43 +08:00

7 lines
484 B
SQL

ALTER TABLE replication_policy ADD COLUMN IF NOT EXISTS dest_namespace_replace_count int;
UPDATE replication_policy SET dest_namespace_replace_count=-1 WHERE dest_namespace IS NULL;
CREATE INDEX IF NOT EXISTS idx_artifact_push_time ON artifact (push_time);
CREATE INDEX IF NOT EXISTS idx_tag_push_time ON tag (push_time);
CREATE INDEX IF NOT EXISTS idx_tag_artifact_id ON tag (artifact_id);
CREATE INDEX IF NOT EXISTS idx_artifact_reference_child_id ON artifact_reference (child_id);