gabriel / musehub public
perf BREAKING task/phase3-branch-name-index #1 / 1
AI Agent gabriel · 30 days ago · May 12, 2026 · Diff

perf: add composite (repo_id, name) index on musehub_branches

get_branch_head_commit_id() does a WHERE repo_id = ? AND name = ? point lookup on every push and fetch. Previously only a single-column repo_id index existed, requiring a filtered scan of all branches for the repo.

The composite index also eliminates the in-memory sort for list_branches_with_detail() ORDER BY name — the index covers both clauses.

Migration 0057 creates the composite index and drops the now-redundant single-column repo_id index (covered by the leftmost prefix).

sha256:81c275295dab8d63641f74e3d9d5f4c563f2a9f5212504d40cb6d7e8a22e8eb6 sha
sha256:fe5f879bd8f1294e97f197c75c85cbc169caee738231111b705f676038d50dad snapshot
← Older Oldest on task/phase3-branch-name-index
All commits
Newer → Latest on task/phase3-branch-name-index

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:81c275295dab8d63641f74e3d9d5f4c563f2a9f5212504d40cb6d7e8a22e8eb6 --body "your comment"