# Database Optimizer (agent)

> Database Optimizer (agent): Database performance optimization with query tuning, indexing strategies, partitioning, and capacity planning

Database Optimizer (agent) is a paid AI agent skill on Agensi by Laravel Company, in Agents & Orchestration. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $4 (one-time purchase)
- Creator: [Laravel Company](https://www.agensi.io/creators/laravelcompany)
- Category: [Agents & Orchestration](https://www.agensi.io/skills/agents-orchestration)
- Version: 1.0
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/database-optimizer-agent
- Tags: ai-agents, laravel, php, data

## About this skill

Slow database queries and unoptimized schemas can kill Laravel application performance. This skill applies a professional database optimization workflow to identify bottlenecks, suggest indexing strategies, and plan for capacity growth.

### What it does
- **Query tuning** analyzes slow SQL or Eloquent queries to find execution plan improvements.
- **Indexing strategies** recommends specific composite or single-column indexes based on access patterns.
- **Schema optimization** identifies structural changes like partitioning or normalization to handle larger datasets.
- **Capacity planning** projects resource requirements and scaling paths for growing data volumes.
- **Risk assessment** flags potential downtime or performance regressions before changes are applied.

### How it works
1. Provide the skill with a slow query, a database schema, or a performance log.
2. The agent identifies missing context and lists necessary assumptions regarding your environment.
3. It generates an optimization plan following strict Laravel and PHP coding standards.
4. You receive a structured report including a summary, technical details, and verification steps.

### Frameworks & tools
This skill is tailored for Laravel and PHP environments, focusing on MySQL or PostgreSQL backends. It adheres to Laravel-specific conventions for migrations and Eloquent performance.

### Why this beats prompting it yourself
Writing a one-off prompt often leads to vague advice like "add an index." This skill uses a multi-step workflow that forces the agent to state assumptions, check security guidelines, and follow a specific output contract for every optimization task.

### Use cases
- Refactor slow Eloquent relationships and eager loading issues.
- Design indexing strategies for large-scale multi-tenant databases.
- Plan table partitioning for logs or historical transaction data.
- Audit database schemas for N+1 query vulnerabilities and architectural flaws.

### Known limitations
This skill provides architectural and query advice but does not execute destructive SQL commands or migrations directly. It requires manual schema input or query logs to provide accurate results.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Database Optimizer (agent) skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Does this optimizer work with any PHP framework, or is it strictly for Laravel?

This skill is purpose-built for Laravel applications using MySQL or PostgreSQL. It specifically understands Eloquent ORM patterns, Laravel migration syntax, and common performance pitfalls like N+1 queries.

### Will the agent automatically execute changes or migrations on my live database?

No, the agent operates in a read-only advisory capacity. It provides optimized SQL, migration code, and architectural plans that you can review and apply manually to ensure full control over your production environment.

### What information do I need to provide for the agent to analyze a bottleneck?

To get the most accurate results, you should provide the relevant table schemas, the slow SQL or Eloquent query, and any existing indexes. The more context you provide about your data volume, the more specific the indexing and partitioning strategies will be.

### What exactly is included in the output report?

The skill provides a structured optimization report including the identified bottleneck, recommended SQL/Migration code, a rationale for the changes, and steps to verify the performance gain.

### Can this skill help with large-scale databases or multi-tenant schemas?

Yes, the agent is designed to handle complex database structures, including multi-tenant architectures and high-volume logging tables. It can suggest advanced strategies like composite indexing and table partitioning specifically for these scenarios.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
