diff --git a/ddl/000007_uncommitted_idx.down.sql b/ddl/000007_uncommitted_idx.down.sql new file mode 100644 index 00000000000..9d1dc4fcd1d --- /dev/null +++ b/ddl/000007_uncommitted_idx.down.sql @@ -0,0 +1,3 @@ +BEGIN; +DROP INDEX IF EXISTS entries_uncommitted_branch_min_commit; +COMMIT; diff --git a/ddl/000007_uncommitted_idx.up.sql b/ddl/000007_uncommitted_idx.up.sql new file mode 100644 index 00000000000..a0b4784b142 --- /dev/null +++ b/ddl/000007_uncommitted_idx.up.sql @@ -0,0 +1,8 @@ +-- partial index on min_commit to locate uncommitted entries +BEGIN; +DROP INDEX IF EXISTS entries_uncommitted_branch_min_commit; +CREATE INDEX entries_uncommitted_branch_min_commit + ON catalog_entries USING btree + (branch_id ASC NULLS LAST, min_commit ASC NULLS LAST) + WHERE min_commit = '1000000000000000000'::bigint; +COMMIT;