Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

## 2024-05-19 - Astro DB (Drizzle) N+1 Query Bottlenecks in Data Aggregation
**Learning:** Sequential full-table fetches using `await db.select()` inside API routes or data-loading functions (like `getMissionBoardOverview`) create a massive waterfall effect, drastically increasing response latency when the database grows.
**Action:** Always group independent `.select()` operations into a concurrent `Promise.all` block. Use ternary operators to conditionally trigger queries inside the array, falling back to `Promise.resolve([])` for missing optional tables, reducing total execution time to the slowest single query.
Loading