Files
multica/server/migrations/535_github_pr_address_index.up.sql
8f1ad46ee8 MUL-7556: index GitHub PR address lookups (#8636)
* perf(db): index GitHub PR address lookups (MUL-7556)

Co-authored-by: multica-agent <[email protected]>

* perf(db): narrow GitHub PR address index (MUL-7556)

Co-authored-by: multica-agent <[email protected]>

* fix(migrations): renumber GitHub PR address index

Co-authored-by: multica-agent <[email protected]>

---------

Co-authored-by: Forge-Boy <[email protected]>
Co-authored-by: multica-agent <[email protected]>
2026-09-22 15:33:23 +08:00

7 lines
445 B
SQL

-- Match the pull-request address used by snapshot refreshes without making the
-- GitHub App installation, which is an authorization scope, part of identity.
-- Leading with pr_number prevents the head-SHA lookup, which has no PR number,
-- from preferring this index over its selective head_sha index.
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_github_pull_request_pr_owner_repo
ON github_pull_request (pr_number, repo_owner, repo_name);