n-plus-one-finder

仓库创建 2026年7月28日最近提交 7 小时前SkillHot 收录 1 小时前
▸ 精选理由

定位常见性能陷阱,能显著降低数据库负载与延迟。

这个 Skill 做什么

检测循环内的数据库 N+1 查询、无界查询及请求内重复读取问题。

帮你自动找出藏在循环里的数据库性能坑,比如常见的 N+1 查询、没有限制的全表查询,以及一次请求里重复读同一数据的情况。页面突然变慢、上线前检查、刚加了列表页或数据库负载升高但流量没变时拿它来查。特别之处是能发现那些在种子数据上看不出来、只会在真实流量下呈二次或平方增长的问题。

▸ 展开 SKILL.md 英文原文

Find database queries running inside loops — the N+1 pattern that is invisible on seed data and quadratic in production — plus unbounded queries with no limit and repeated identical reads in one request. Use when a page is slow, before a launch, after adding a list view, or when database load rises without traffic rising.

开发编程N+1问题性能分析数据库查询通用
0
Stars
0
Forks
20
仓库内 Skill
积累中
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/sriptcollector/toolbay-skills/main/skills/n-plus-one-finder/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/sriptcollector/toolbay-skills/main/skills/n-plus-one-finder/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# N+1 Finder

## Install

Save this file as `~/.claude/skills/n-plus-one-finder/SKILL.md`, or
`.claude/skills/n-plus-one-finder/SKILL.md` to scope it to one repo. Claude Code
auto-discovers it. Invoke with `/n-plus-one-finder` or by asking "why is this page
slow?".

## Why this exists

N+1 is the most common serious performance bug in application code and the easiest
to ship, because it is invisible exactly where you develop. With 10 seed rows it
costs 11 fast local queries and nobody notices. With 10,000 rows and network
latency it is 10,001 round trips and the page times out.

It is also the bug that scales with your success. It appears the week traffic
arrives, which is the week you can l
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有