# Database Schema ERD & Index Optimizer

> Turn raw SQL DDL or plain English into 5-notation ERD diagrams, AI index optimizations, query plan breakdowns, and mock seed data.

Database Schema ERD & Index Optimizer is a free AI agent skill on Agensi by Saran Boddu. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Saran Boddu](https://www.agensi.io/creators/saran-boddu)
- Version: 1.0
- Last updated: 2026-12-04
- Security: scan passed (2026-12-04); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/database-schema-erd-index-optimizer
- Tags: data-databases, apis-backend, code-quality-review, technical-documentation

## What it does

- Turns your SQL tables or plain English ideas into clear entity-relationship diagrams
- Switches between Crow's Foot, Peter Chen, UML, Bachman, and Star Schema views
- Finds missing database indexes and writes ready-to-run speedup scripts
- Explains slow database queries step by step with cost and bottleneck fixes
- Converts table schemas across PostgreSQL, MySQL, SQLite, Oracle, and Snowflake
- Generates realistic test rows in the right table order without breaking links

## Who it's for

- **Backend engineers designing APIs:** Turns rough table ideas into indexed schemas and diagrams in seconds. Try: "Design a multi-tenant SaaS billing schema and show a Crow's Foot diagram"
- **Database architects auditing slow queries:** Spots missing indexes and explains query plans with ready-to-run fixes. Try: "Audit this PostgreSQL DDL for missing indexes and explain my slow JOIN query"
- **Analytics teams building warehouses:** Models Star and Kimball fact-dimension schemas and converts SQL dialects. Try: "Convert this MySQL order schema into a Snowflake Star Schema"
- **Founders and teams documenting apps:** Generates clean ERDs, Prisma/DBML docs, and realistic mock seed data. Try: "Generate 10 rows of referentially valid SQL seed data for these tables"

## About this skill

### The Problem
Designing, auditing, and documenting relational databases usually means juggling separate ERD tools, slow query analyzers, and manual dialect migrations. Raw SQL DDL is hard to visualize, and missing foreign-key or composite indexes often go unnoticed until production slows down.

### How It Works
**Database Schema ERD & Index Optimizer** turns your AI agent into a senior database architect. Paste your `CREATE TABLE` SQL, describe a new feature in plain English, or share a slow query:
1. **Parses & Normalizes**: Extracts tables, columns, primary/foreign keys, unique constraints, and existing indexes.
2. **Visualizes in 5 Notations**: Renders clean Mermaid diagrams in Crow's Foot, Peter Chen, UML Class / IDEF1X, Bachman DSD, or Star / Kimball Dimensional format.
3. **Audits & Optimizes**: Flags missing indexes, redundant indexes, and normalization gaps, outputting ready-to-run `CREATE INDEX` migration scripts.
4. **Explains Queries & Transpiles**: Breaks down execution plans (Seq Scan vs. Index Scan, Hash vs. Nested Loop joins) and converts DDL across PostgreSQL, MySQL, SQLite, SQL Server, Oracle, and Snowflake.

### Why This Beats Prompting It Yourself
- **Enforces Topological Order**: Parent tables and seed rows are always ordered before child dependencies.
- **Multi-Notation Rigor**: Uses dedicated notation rules (`references/notations-guide.md`) and dialect type mappings (`references/dialect-reference.md`) so cardinality symbols and data types stay accurate.
- **Production-Safe Output**: Reminds you about non-blocking index creation (`CONCURRENTLY`) and non-sargable query anti-patterns.

### Known Limitations
- Connects to your pasted DDL and queries in-context; it does not connect directly to live production database servers.

## Requires

Nothing beyond your AI agent.

## Technical details

Universal SKILL.md package containing SKILL.md plus references/notations-guide.md (Crow's Foot, Peter Chen, UML/IDEF1X, Bachman DSD, Star/Kimball) and references/dialect-reference.md (PostgreSQL, MySQL, SQLite, T-SQL, Oracle, Snowflake). Compatible with Claude Code, Cursor, Codex CLI, Gemini CLI, and VS Code Copilot. No local runtime or API keys required.

## 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 Schema ERD & Index Optimizer skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Do I need to install anything or provide a database connection?

No. Everything runs inside your AI agent using the included skill instructions and reference guides—no local CLI tools, database connections, or external API keys are needed.

### Which SQL dialects are supported?

It supports PostgreSQL, MySQL / MariaDB, SQLite, Microsoft SQL Server (T-SQL), Oracle Database, and Snowflake SQL.

### Can I switch ERD notations for the same schema?

Yes. You can request Crow's Foot, Peter Chen, UML Class / IDEF1X, Bachman Data Structure Diagram, or Star / Kimball Dimensional Schema at any time.

---

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.
