Skip to content
Adrian Cole Adrian Cole

Performance

MySQL Indexes That Actually Speed Up Your Laravel App

The indexes I add to almost every Laravel project, and how to verify they are used.

·1 min read #Laravel#MySQL#Performance

Start with your queries

Indexes should follow the queries you actually run. In a portfolio or CMS, that usually means published content ordered by date, slugs for detail pages, and foreign keys for relationships.

Common wins

  • Unique index on slug
  • Composite index on (is_published, published_at)
  • Indexes on foreign keys such as category_id
  • Composite index on (date, path) for analytics rollups

Verify, do not guess

Use EXPLAIN on slow queries and Laravel Debugbar in local development. An index that is never used is just write overhead.

Need help with a Laravel project?

Let's talk about how I can help.

Book a call

Keep reading