Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Database Optimizer

ASecurity

Org role guidance for a database optimizer: tune PostgreSQL and MySQL schemas, queries and indexes with EXPLAIN ANALYZE, pooling and non-locking migrations.

21 stars
0 votes
0 copies
0 views
Added 9/22/2026
databasesrustsqlreactgitdatabasedevopsperformance

Security Analysis

A100/100

Scanned 9/28/2026

$npx -y skills add monoes/monomind --skill database-optimizer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Database Optimizer?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Database Optimizer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/monoes-database-optimizer/badge)](https://www.skillsdirectory.com/skills/monoes-database-optimizer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: database-optimizer
description: "Org role guidance for a database optimizer: tune PostgreSQL and MySQL schemas, queries and indexes with EXPLAIN ANALYZE, pooling and non-locking migrations."
tags: ["devops","database","postgres","performance","sql"]
tools: []
license: Apache-2.0
source: https://github.com/monoes/monomind
---
# Database Optimizer — Best Practices

## Focus
Optimizes schema design, queries, and indexing for relational databases (PostgreSQL, MySQL, Supabase, PlanetScale) so systems perform under load and don't page anyone at 3am.

## Best practices
- Run EXPLAIN ANALYZE before deploying any non-trivial query — check actual time vs. planned time and rows vs. estimated rows, not just "it returned results."
- Index every foreign key used in joins — unindexed joins are the single most common cause of unexpected sequential scans.
- Avoid `SELECT *` — fetch only the columns a query actually needs to reduce I/O and network payload.
- Prevent N+1 queries by using JOINs or batched loading instead of looping queries per row in application code.
- Use connection pooling (PgBouncer, transaction-mode poolers) — never open a raw connection per request, especially in serverless contexts.
- Write migrations that are reversible and non-locking — use `CREATE INDEX CONCURRENTLY`, add columns with defaults that don't rewrite the table.
- Choose normalization vs. denormalization deliberately per access pattern, not dogmatically — document the trade-off made.

## Common pitfalls
- Adding indexes reactively after a production slowdown instead of reviewing query plans during development.
- Locking tables in production migrations by using blocking `CREATE INDEX` or full-table rewrites.
- Trusting an ORM's default query generation without checking for hidden N+1 patterns.
- Over-normalizing a schema for theoretical purity when the actual access pattern demands a denormalized read path.

## Tools & techniques
- `EXPLAIN ANALYZE` read as standard practice: look for Seq Scan (red flag), Index Scan / Bitmap Heap Scan (expected).
- `pg_stat_statements` or platform-equivalent slow-query logs monitored continuously, not just during incidents.
- Partial and composite indexes for common filter+sort patterns rather than one broad index per column.
- Connection pooler configuration (pool size, mode) tuned against actual concurrent connection counts.

Attribution

monoesmonoes
View sourceSee grades on GitHubMore from monoes →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Mysql Best Practices

MySQL development best practices for schema design, query optimization, and database administration

2481 votes

Jpa Patterns

Spring Boot中的JPA/Hibernate实体设计、关系、查询优化、事务、审计、索引、分页和连接池模式。

2456590 votes

Clickhouse Io

ClickHouse数据库模式、查询优化、分析和数据工程最佳实践,适用于高性能分析工作负载。

2456590 votes

Postgres Patterns

基于Supabase最佳实践的PostgreSQL数据库模式,用于查询优化、架构设计、索引和安全。

2456590 votes

Sql Pro

Master modern SQL with cloud-native databases, OLTP/OLAP

458250 votes
View all in databases →