TL;DR: Enable D1 Insights index recommendations via dashboard, CLI, or API; apply suggested CREATE INDEX statements to cut rows-read charges and query latency.
Cloudflare shipped D1 Insights index recommendations on November 25, 2026. The feature analyzes D1 databases in the background and emits CREATE INDEX statements for queries that scan many more rows than they return. Each recommendation includes the expected query speedup and usage metrics. This migration fix log documents how to enable the feature, apply recommendations safely, and avoid the hidden cost traps that appear when index usage scales.
Verified Key Facts
| Metric / Signal | Finding |
|---|---|
| Recommendations per database | Up to 10 recommendations, highest impact first |
| CLI command to list recommendations | npx cf d1 insights recommendations |
| API endpoint for recommendations | https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/d1/insights/recommendations |
| Recommendation expiry | 7 days without refresh |
| API limit parameter range | 1 to 100 recommendations per page, default 20 |
| Database ID filter limit | Up to 50 database IDs per request |
Inside the Full Technical Dispatch
- Migration Trigger: D1 Insights Index Recommendations Launch
- Cost & Platform Limits Table
- Measured Bottlenecks & Hidden Billing Traps
- Production Configuration Snippet
- Migration Checklist & Break-Even Thresholds
Read the full analysis, runnable configurations, benchmark tables, and primary source citations on Pyvren.
Originally published on Pyvren by Hamdi Soudani.
Top comments (0)