query-optimization SKILL.md skillA
query-optimization from nahid-sparktales/agent-dispatcher is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add nahid-sparktales/agent-dispatcher/query-optimization@git:20260919.a0d4f55Pins git:20260919.a0d4f55 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- nahid-sparktales/agent-dispatcher
- Path
skills/database/query-optimization/SKILL.md- Versions recorded
- 1
- Latest version
- git:20260919.a0d4f55, committed Sep 19, 2026
- Size
- 7,227 bytes
- Repository stars
- 58
- License
- MIT
Make one slow query fast without guessing — capture the plan, find where the time actually goes, change one thing, and measure again on comparable data. Use when a query, endpoint or report is slow and the database is the suspect, when a plan needs reading, or when someone proposes an index with no evidence. Not for modelling decisions about tables and constraints, not an engine feature reference, and not for system-wide performance work where the database has not yet been shown to be the…
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Query optimization An index added on a hunch is a permanent write cost bought with no evidence. The work here is measurement: the plan before, one change, the plan after, on data that resembles the data that is actually slow. ## When this fires A specific statement is slow, or a plan needs interpreting, or a proposed index needs justifying. It does not fire before the database has been shown to be where the time goes — if that is still open, measure the request end to end first. It does not fire for redesigning the tables. ## Procedure 1. **Get the exact statement and its parameters.** Not "the dashboard is slow" — the SQL text as the database received it, with the bind values, and where it runs from. A statement-statistics view, the ORM's query log or the application log will have it. The parameters matter: the same query can take different plans for different values. 2. **Confirm the database is the bottleneck.** Compare the statement's own time against the total request time. If the query is 40ms of a 3s request, stop here and say so. Note whether the cost is one slow statement or many fast ones — an N+1 is fixed in the calling code, not by an index. …
Read the whole file at its exact version.
How to install
mdr add nahid-sparktales/agent-dispatcher/query-optimization@sha256:7c0784025e6fb182The line at the top of this page pins the label git:20260919.a0d4f55, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_2d5hqmfpii4rs77c)
4 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 1 version of this file, committed on Sep 19, 2026.
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (7227 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
nahid-sparktales/agent-dispatcher · 58 stars · license MIT · pushed 2026-10-24 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_2d5hqmfpii4rs77c GET https://markdownregistry.com/api/v1/resolve?ref=nahid-sparktales/agent-dispatcher/query-optimization GET https://markdownregistry.com/api/v1/blob/7c0784025e6fb18213ca57871eac6fc5c5f9e45626e1baa1b83d72d71aff88ac
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.