laravel-database-optimization

Optimize Laravel 13 database queries with eager loading and indexing strategies.

Updated May 11, 2026
One-click install
npx skills add https://github.com/irizqi/agent-skills --skill laravel-database-optimization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-database-optimization
Source: https://github.com/irizqi/agent-skills/tree/main/skills/laravel-database-optimization
Command: npx skills add https://github.com/irizqi/agent-skills --skill laravel-database-optimization

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill addresses performance bottlenecks in Laravel 13 applications by providing actionable patterns to eliminate N+1 queries, optimize indexing, and manage large datasets efficiently.

Core Features & Use Cases

  • Query Optimization: Detects and resolves N+1 issues using eager loading and automatic relationship batching.
  • Indexing Strategies: Provides guidance on implementing composite and covering indexes to accelerate read-heavy operations.
  • Performance Monitoring: Integrates debugging tools like EXPLAIN ANALYZE and Laravel Debugbar to identify slow queries before they reach production.

Quick Start

Apply the laravel-database-optimization skill to analyze my current Eloquent queries and suggest indexing improvements for the users table.

Frequently Asked Questions about laravel-database-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix N+1 query issues in Laravel Eloquent?

Fix N+1 query issues in Laravel Eloquent by implementing eager loading and automatic relationship batching to eliminate redundant database calls and reduce query latency.

What's the best way to optimize database indexing for read-heavy Laravel applications?

Optimize database indexing for read-heavy Laravel applications by implementing composite and covering indexes to accelerate data retrieval and improve overall query performance.

How does Redis caching improve Laravel database performance?

Redis caching improves Laravel database performance by storing frequently accessed data in memory, bypassing expensive database queries and significantly reducing application response times.

How do I monitor slow database queries in Laravel before production?

Monitor slow database queries in Laravel before production by integrating debugging tools like EXPLAIN ANALYZE and Laravel Debugbar to identify and resolve performance bottlenecks early.

Can I apply database optimization strategies during zero-downtime migrations in Laravel?

Apply database optimization strategies during zero-downtime migrations in Laravel to modify indexing and table structures without interrupting production availability or causing service degradation.