f9980900b125779084e7cc6d50ee3cb395823481
The dashboard's occupancy-timeline metric was firing N separate queries (one per day, 30 for .30d / 90 for .90d) that saturated the postgres pool and stalled every other request in the app. Replace with a single query using generate_series for the date range + LEFT JOIN onto active reservations + COUNT(DISTINCT berth_id) GROUP BY day. Same data, ~30× fewer queries on .30d, ~90× fewer on .90d. The snapshot cache layer still applies, so cached reads are still zero-DB. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Description
No description provided
Languages
TypeScript
98.7%
HTML
1%
CSS
0.1%
Shell
0.1%