/ tag
Performance
3 posts on this topic.
-
The Postgres features I reach for before I reach for a cache
A slow multi-tenant Rails app usually isn't slow because Postgres is slow. It's slow because the work is being done in Ruby that Postgres would do better. DISTINCT ON, array overlap, and full-text search — with the honest limits.
-
Aggregating in SQL vs in memory: a Laravel dashboard performance lesson
Two chart methods in an old Laravel CRM — one aggregates counts in SQL, the one right below it loads every record into memory and sums them in a PHP closure. A dashboard performance lesson at millions of rows, and the junior-to-mid growth arc behind it.
-
The availability search that loaded every booking into memory — a Rails date-range fix
A marketplace 'search by dates' feature quietly became O(bookings × listings): it pulled every booking in the database into Ruby and eliminated listings one query at a time. The fix was a single overlap query the codebase already had — and never used.