You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(backfill): use skills.latest_semver join and add --random flag
Two related changes to make the scan-report backfill usable at scale
and able to produce representative samples:
- Replace the ROW_NUMBER() OVER (PARTITION BY skill_id ORDER BY
created_at DESC) subquery with a direct join on the denormalized
skills.latest_semver pointer. The window-function variant trips the
30s statement_timeout on the current versions table; the new query
runs in well under a second.
- Add a --random flag that swaps the ORDER BY from (org_slug, name)
to random(). Alphabetical ordering concentrated --limit N batches
on a handful of orgs (e.g. 77% of the first 200-skill run landed
on a single prolific publisher); random order spreads the same
sample across ~80 orgs with no single org over 10%, which is what
we want for the distribution stats in #329.
Made-with: Cursor
0 commit comments