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:
13
analyze_duplicates.sh
Executable file
13
analyze_duplicates.sh
Executable 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"'
|
||||
Reference in New Issue
Block a user