Code Optimizer for Laravel: 5,361 Queries Down to 5

A Laravel list route made 5,361 queries and took 2,326 ms; eager loading cut the queries to 5, and three missing indexes cut the time to 194 ms.

Pagination took the route to 4 ms and cut the response from 177,579 bytes to 2,655 bytes, but it changes the response shape.

One Claude Code pass fixed the eager loading and column selection for $0.12, named the missing indexes, and did not add them or paginate.

Read the full post

Read the full post