cloudflare-d1-query-tuning

Community

Tune slow Cloudflare D1 queries without schema.

Authormatt-riley
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Cloudflare D1 query performance can degrade in D1-backed repos due to N+1 lookups, over-fetching, and poorly paginated queries. This skill guides safe, no-schema-change tuning that preserves data contracts and repo behavior.

Core Features & Use Cases

  • D1 runtime inspection: use wrappers and commands like wrangler d1 execute and EXPLAIN QUERY PLAN to understand the slow path without changing data access contracts.
  • No-schema tuning: pushes filtering, limiting, and path optimization into SQL to reduce scans and round trips.
  • Real-world scenarios: ideal for Cloudflare Workers data access layers with N+1 patterns, over-fetching, or pagination bottlenecks in production.

Quick Start

Reproduce the slow path with the exact D1 binding and apply a set-based rewrite to reduce scans while preserving results.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: cloudflare-d1-query-tuning
Download link: https://github.com/matt-riley/agent-skills/archive/main.zip#cloudflare-d1-query-tuning

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 510,000+ vetted skills library on demand.