ORM N+1 Query Bottleneck Exterminator
Finds the lazy attribute access inside a loop that turns one request into hundreds of queries, and rewrites it as eager loading or a window function - without replacing it with a cartesian join.
$5
/moSubscription · cancel anytime
Secure checkout via Stripe
- Always the latest version
- Delivered live to your agent via MCP
- Cancel anytime, access ends at period end
About this skill
ORM N+1 Query Bottleneck Exterminator One query, then one more per row. The page is fine with ten records and unusable with a thousand.
Built for backend developers working through an ORM. Runs on Claude, Codex, Hermes, Gemini, and GPT-4 and any framework that loads a SKILL.md.
What's included:
- Defined input contract: your models and the query path, analysed with a local SQL parser.
- Deterministic decision engine: traces where a relationship attribute is touched inside an iteration - the line that triggers the extra query is usually innocuous-looking and nowhere near the query that fetched the collection. It reports the query count as a function of row count, which is what makes the problem legible.
- The right fix per case: a join-based eager load where the relation is single-valued, a separate prefetch where it is a collection, or a window function where an aggregate per row is what is actually wanted.
- The counter-check: eager loading everything is its own failure. Joining several one-to-many relations in one query multiplies rows, and the result is slower than the N+1 it replaced - so the prescription says which relations to load together and which to fetch separately.
- Audit-ready deliverable: the offending access sites, the rewritten query, and the before-and-after query count.
Runs on local parsing and an in-memory database for validation; credentials come from environment variables and are never printed.
Confirm against query logs with production-like data volumes. An ORM's generated SQL varies by version and dialect, and the only honest measure of the fix is the query count and latency it actually produces.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 6 days ago
- Accounts
OpenAI
Permissions
Allowed Hosts
This skill calls OpenAI GPT-4o-mini (paid). 1 of these is billed by its provider, not by us; you supply the account. It reads OPENAI_API_KEY from your environment; credentials are never hardcoded, stored, logged or echoed. It also expects these installed locally: Local SQL Parser, Local SQLite Memory DB. Please note: the description on this listing states that no API keys or paid services are needed. That is incorrect - the services above are required. Listing text cannot be edited after approval, so treat this permissions block as the authoritative statement of what the skill needs.
What's inside
Frequently Asked Questions
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.