Performance · 2026
From timeouts to under 3 seconds
A Laravel dashboard with 177,000+ tickets kept timing out, and its Excel export never finished.
- 177k+
- tickets
- < 3s
- load time
- 5k
- rows per batch
The problem
One big subquery was trying to find the latest assignment for every ticket at once. With more than 27,000 new tickets a month, the database couldn't keep up, and the export just hung.
What we did
- 01
Replaced the one huge join with smaller batches of 3,000 to 5,000 records.
- 02
Matched and merged the results in PHP, instead of making the database do all of it.
- 03
Changed the Excel export to build straight from the data instead of rendering a page first.
- 04
Worked out the totals in the same loop, so the duplicate total queries could go.
How it turned out
The dashboard loads in under 3 seconds now. The export that used to hang forever finishes in a few seconds.