Fix bd-666: Replace N+1 query pattern in auto-import with batch fetch

- Batch fetch all existing issues with SearchIssues() upfront
- Use O(1) map lookup instead of O(n) GetIssue() calls
- Improves performance dramatically with 1000+ issues
- All tests pass
This commit is contained in:
Steve Yegge
2025-10-16 19:14:05 -07:00
parent 37d60d624d
commit ef31d98b43
6 changed files with 1413 additions and 164 deletions

13
analyze_duplicates.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
# Analyze duplicate issues
echo "# Duplicate Issues Report"
echo ""
echo "Generated: $(date)"
echo ""
./bd list --json | jq -r 'group_by(.title) | .[] | select(length > 1) | {
title: .[0].title,
count: length,
issues: [.[] | {id, status, created_at}]
} | "## \(.title)\nCount: \(.count)\n" + (.issues | map("- \(.id) (\(.status)) created \(.created_at)") | join("\n")) + "\n"'