Repository navigation
perf(registry): cut D1 reads and writes per Skill page render - #305
Merged
Merged
Conversation
A crawler burst on 2026-09-29 rendered 392 uncached Skill pages in two minutes and D1 answered "overloaded". Each render cost 15 reads and a write-back of rendered_html whenever the stored render was over 30 minutes old. The detail now resolves the Skill and its whole row in one statement and reads generated content in one, the related route reuses the lookup row for its commit source, and an owner/repo/name slug no longer tries the slug column first. Page views stop writing renders; the repo sync and reconcile-rendered own that. Migration 0125 indexes the same-repo list and the resolved-Skill count.
The migration naming check rejects a gap, and 0124 is not on main yet. #304 also claims 0124, so whichever pull request merges second renumbers.
1 task done
1 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
❓ Type of change
📚 Description
On 2026-09-29 a residential-proxy crawler rendered 392 uncached Skill pages in two minutes, and D1 answered "overloaded". Each render cost about 15 D1 reads and, for any render older than 30 minutes, a GitHub refetch plus an
UPDATE skills SET rendered_html…: 557 writes in that burst. Read replicas (#303) cannot absorb those writes, and 69% of D1 time went to one same-repo list query that sorted in a temp B-tree.This PR makes three changes:
owner/repo/nameslug skips theskills.sluglookup. That column is alwaysowner/name(all 14,620 prod rows), so the lookup always missed.skills(owner, repo, modified_at DESC, name)andskills(owner, repo, source_resolved).Measured on a local copy of production data (84k Skills), five sample Skills including the 1,344-Skill
jeremylongshore/claude-code-plugins-plus-skills. Figures are per render, from workerdmeta.rows_read:/api/skills/**before/api/skills/**after/api/skill-related/**before/api/skill-related/**afterThe same-repo list on the 1,344-Skill repo went from 4,034 rows to 8. The plan loses
USE TEMP B-TREE FOR ORDER BY, with or withoutsqlite_stat1. The duplicate-candidates list is left out of these figures because the cache serves it.Behaviour changes
reconcile-renderedrepairs them every 6 hours.rendered_atstops moving on page views, so the AI-ready MarkdownupdatedAtnow tracks the last real render.Not done here: the same-owner related list (about 1.4k rows on big owners) and the full repo name list for dependency links (1,345 rows on the biggest repo) are still the largest reads per render.
idx_skills_owner_repoduplicates the primary key prefix, and I left it in place.0124_migration.migration-namingrejects both a gap and a duplicate, so whichever PR merges second renumbers its file to 0125.