agentsclimarketplace

Query performance

Skill saifoelloh/golang-best-practices-skill/query-performance

Production-ready Go code review skill for AI agents based on authoritative sources

Install
npx -y skills add saifoelloh/golang-best-practices-skill --skill query-performance

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 16 stars16 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

GORM + PostgreSQL query performance review. Use when optimizing slow queries, designing indexes, analyzing N+1 patterns, or configuring connection pools. Trigger on "slow", "optimize", "index", "EXPLAIN", "N+1", or performance degradation.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

2.4 KB, as published. Nobody here has run it

Query Performance

Expert-level performance review for GORM + PostgreSQL queries. Detects N+1 patterns, missing indexes, connection pool misconfigurations, and memory-inefficient data fetching.

When to Apply

Use this skill when:

  • An endpoint is slow or degrading under load
  • Reviewing repository code for N+1 query patterns
  • Designing indexes for new tables or query patterns
  • Investigating connection pool exhaustion
  • Processing large datasets in background jobs

Rule Categories

PriorityCountFocus
Critical2N+1 queries, unindexed foreign keys
High3EXPLAIN ANALYZE, connection pool, batch processing
Medium2COUNT vs len(), partial indexes

Rules Covered (7 total)

Critical Issues (2)

  • critical-n-plus-one — Detect and eliminate N+1 query patterns using Preload
  • critical-unindexed-fk — Index foreign keys and all WHERE clause columns

High-Impact Patterns (3)

  • high-explain-analyze — Use EXPLAIN (ANALYZE, BUFFERS) before declaring a query optimized
  • high-connection-pool — Configure connection pool parameters explicitly for production
  • high-find-in-batches — Use FindInBatches for large dataset processing

Medium Improvements (2)

  • medium-count-query — Use db.Count instead of len() on full fetch
  • medium-partial-index — Use partial indexes for filtered queries on large tables

Trigger Phrases

  • "Why is this query slow?"
  • "Optimize this query"
  • "Check for N+1"
  • "Add an index"
  • "EXPLAIN output"
  • "Performance issue"
  • "Connection pool"
  • "Process large dataset"

Related Skills

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.