Introduces a materialized cache table to store blocked issue IDs, replacing the expensive recursive CTE computation that was causing ~752ms query times on 10K databases (bd-5qim). The cache is maintained via invalidation on dependency and status changes, reducing GetReadyWork from O(n²) recursive traversal to O(1) cache lookup. Technical details: - New blocked_issues_cache table with single issue_id column - ON DELETE CASCADE ensures automatic cleanup - Migration populates cache using existing recursive CTE logic - rebuildBlockedCache() fully rebuilds cache on invalidation - execer interface allows both *sql.DB and *sql.Tx usage 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
4.1 KiB
4.1 KiB