home / skills / jeremylongshore / claude-code-plugins-plus-skills / database-query-profiler

This skill helps optimize database query profiler tasks by automating guidance, configurations, and validation for performance testing.

npx playbooks add skill jeremylongshore/claude-code-plugins-plus-skills --skill database-query-profiler

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.2 KB
---
name: "database-query-profiler"
description: |
  Profile database query profiler operations. Auto-activating skill for Performance Testing.
  Triggers on: database query profiler, database query profiler
  Part of the Performance Testing skill category. Use when working with database query profiler functionality. Trigger with phrases like "database query profiler", "database profiler", "database".
allowed-tools: "Read, Write, Edit, Bash(cmd:*)"
version: 1.0.0
license: MIT
author: "Jeremy Longshore <[email protected]>"
---

# Database Query Profiler

## Overview

This skill provides automated assistance for database query profiler tasks within the Performance Testing domain.

## When to Use

This skill activates automatically when you:
- Mention "database query profiler" in your request
- Ask about database query profiler patterns or best practices
- Need help with performance testing skills covering load testing, stress testing, benchmarking, and performance monitoring.

## Instructions

1. Provides step-by-step guidance for database query profiler
2. Follows industry best practices and patterns
3. Generates production-ready code and configurations
4. Validates outputs against common standards

## Examples

**Example: Basic Usage**
Request: "Help me with database query profiler"
Result: Provides step-by-step guidance and generates appropriate configurations


## Prerequisites

- Relevant development environment configured
- Access to necessary tools and services
- Basic understanding of performance testing concepts


## Output

- Generated configurations and code
- Best practice recommendations
- Validation results


## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| Configuration invalid | Missing required fields | Check documentation for required parameters |
| Tool not found | Dependency not installed | Install required tools per prerequisites |
| Permission denied | Insufficient access | Verify credentials and permissions |


## Resources

- Official documentation for related tools
- Best practices guides
- Community examples and tutorials

## Related Skills

Part of the **Performance Testing** skill category.
Tags: performance, load-testing, k6, jmeter, benchmarking

Overview

This skill automates and guides database query profiling tasks for performance testing. It helps identify slow queries, capture execution plans, and produce actionable optimizations. Use it to generate reproducible profiling steps, configuration snippets, and validation checks for production and test environments.

How this skill works

The skill inspects query patterns, execution statistics, and schema metadata to prioritize hotspots. It suggests profiling commands, captures runtime traces or EXPLAIN plans, and produces summaries with recommended indexes, query rewrites, or configuration changes. Outputs include runnable scripts, configuration examples, and validation checks you can apply immediately.

When to use it

  • When you need to find and fix slow or resource-heavy queries
  • During load, stress, or benchmarking tests to collect query-level metrics
  • When automating performance regression checks in CI/CD pipelines
  • While preparing optimization recommendations before capacity planning
  • When validating database tuning changes after deployment

Best practices

  • Profile on realistic data volumes or use representative data subsets
  • Correlate query traces with system metrics (CPU, I/O, locks) for root-cause analysis
  • Capture execution plans before and after changes to measure impact
  • Use reproducible scripts and version-controlled configurations for profiling runs
  • Limit profiling duration and scope in production to avoid overhead

Example use cases

  • Generate step-by-step profiling script for PostgreSQL including EXPLAIN ANALYZE and pg_stat_statements summaries
  • Create a CI job that runs targeted query profiles and fails on latency regressions
  • Recommend index additions and query rewrites based on captured execution plans
  • Produce a report comparing query latency and resource usage across schema versions
  • Validate tuning changes by re-running profiles and comparing before/after metrics

FAQ

What environments are required?

A configured development or test database with representative data, access credentials, and profiling tools enabled (for example pg_stat_statements for PostgreSQL).

Can this run in production?

Yes, but limit scope and duration. Use read-only traces, sampling, or low-overhead metrics to minimize impact and schedule during low traffic windows.