database-optimization
Optimize Database Performance
Slow queries and weak indexes can make applications costly and unreliable. This skill guides SQL tuning, index design, caching, and N+1 fixes.
Install with my Agent
Copy this request to your Agent. It includes the canonical Skill page and manifest.
Review the Skillstore skill "database-optimization" from https://skillstore.io/skills/89jobrien-database-optimization.md and its manifest at https://skillstore.io/api/skills/89jobrien-database-optimization/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.Your Agent should still show its plan and request any confirmation required by the security policy.
Agent-readable resources
Use these links when an AI agent, crawler, or script needs clean context instead of reading the full page.
Test it
Using "database-optimization". A user lookup query scans a large table and filters by email.
Expected outcome:
- The likely issue is a missing index on the email column.
- Add a focused index and return only needed columns.
- Measure the change with the database query planner before release.
Using "database-optimization". A page loads users, then loads posts for each user inside a loop.
Expected outcome:
- This is an N+1 access pattern because each user triggers another query.
- Use eager loading, prefetching, or a join based on the ORM and response shape.
- Verify total query count and response time after the change.
Using "database-optimization". A dashboard repeats expensive aggregate queries for every request.
Expected outcome:
- Cache the aggregate result with a clear expiration policy.
- Invalidate or refresh the cache when related source data changes.
- Track cache hit rate and stale data risk during rollout.
Security Audit
SafeThe static command execution alerts are Markdown code fences and database examples, not executable shell use. The reconnaissance alerts are SQL optimization examples about SELECT patterns and indexing. No prompt injection, data exfiltration, or malicious intent was found in SKILL.md or references/query-patterns.md.
Risk Factors
Share & cite this report
Share the versioned assessment report, neutral badge, embed card, and citations. Skillstore reports evidence without deciding whether this Skill is safe.
Copy report link
https://skillstore.io/skills/89jobrien-database-optimization/audits/6?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown badge
[](https://skillstore.io/skills/89jobrien-database-optimization?utm_source=security_passport_badge)HTML badge
<a href="https://skillstore.io/skills/89jobrien-database-optimization?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/89jobrien-database-optimization/security.svg" alt="Skillstore security assessment" loading="lazy"></a>Embed card
<iframe src="https://skillstore.io/embed/skills/89jobrien-database-optimization.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>Academic citations (APA ยท BibTeX ยท CFF)
APA citation
Joseph OBrien. (2026). database-optimization security audit report (audit version 6) [Author version 1.0.1]. Skillstore. https://skillstore.io/skills/89jobrien-database-optimization/audits/6BibTeX citation
@techreport{joseph-obrien-89jobrien-database-optimization-2026,
author = {Joseph OBrien},
title = {database-optimization security audit report (audit version 6)},
institution = {Skillstore},
year = {2026},
number = {6},
url = {https://skillstore.io/skills/89jobrien-database-optimization/audits/6},
note = {Author version 1.0.1}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "database-optimization security audit report (audit version 6)"
version: "1.0.1"
type: report
authors:
- name: "Joseph OBrien"
date-released: "2026-07-05"
url: "https://skillstore.io/skills/89jobrien-database-optimization/audits/6"
identifiers:
- type: other
value: "skillstore:89jobrien-database-optimization:audit:6"
description: "Skillstore immutable audit report identifier"
Skillstore Score
Why this score Evidence Confidence: HighWhat You Can Build
Tune slow customer queries
Review a slow query, explain likely causes, and suggest safer SQL and indexes.
Reduce ORM query volume
Find N+1 patterns in application code and suggest eager loading or joins.
Plan database performance work
Create a practical optimization checklist for indexes, caching, monitoring, and migrations.
Try These Prompts
Review this slow SQL query. Explain the main bottlenecks and suggest simple improvements.
Given this schema and query workload, recommend indexes and explain why each index helps.
Analyze this ORM code for N+1 query patterns. Suggest eager loading, joins, or batching where appropriate.
Build a database optimization plan using these queries, schema details, query plans, and traffic patterns.
Best Practices
- Share query plans, table sizes, existing indexes, and workload patterns for better recommendations.
- Measure before and after each change using production-like data and realistic traffic.
- Balance read speed, write cost, storage growth, and operational complexity.
Avoid
- Do not add indexes without checking query patterns and write impact.
- Do not cache database results without an invalidation or freshness plan.
- Do not optimize one query while ignoring total request query count.
Frequently Asked Questions
Which databases does this skill support?
Can it read my production database directly?
Does it write database migrations?
Can it help with N+1 problems?
Does it replace database monitoring tools?
What should I include in a prompt?
Developer Details
Author
Joseph OBrienLicense
MIT
Author version
v1.0.1
Skillstore revision
r1
Ref
c4037264bbd363c572662d6154a3ab28f5ca4f53
Maintenance freshness
7/18/2026
Usage
19 downloads ยท 241 views
File structure