Shortest time to N comps milestone
PersonOne SQL pulls all (cuber, comp, date) sorted; TS computes 9 milestones (5/10/25/50/100/150/200/250/300) each: date of N-th comp − date of 1st + 1 day.
Short-window counterpart to competitions_per_year_by_person — that one is lifetime annualized; this one captures pure burn-rate during the run-up.
By the numbers
9
Milestones
5/10/25/50/100/150/200/250/300
Top 20
Per-section depth
Each milestone separate top 20
+1 day
Day offset
Inclusive of both endpoints
Data source
results with DISTINCT (person_id, competition_id, start_date), sorted by start_date. TS groups by person to get dates[]; dates[count-1] is the N-th comp, diffed against dates[0].
sql
SELECT person_link, start_date
FROM (SELECT DISTINCT person_id, competition_id, start_date
FROM results
JOIN competitions ON competitions.id = competition_id) cd
JOIN persons person ON person.wca_id = person_id AND sub_id = 1
ORDER BY start_dateAlgorithm / pipeline
1
Pull the timeline
SQL only emits (person, date) rows, internally date-sorted — TS just pushes into an array and gets time order for free.
2
Bucket dates[] per person
Map<person, Date[]>; array length = total comps for that cuber.
3
Days per milestone
dates.length >= count to qualify; days = floor((dates[count-1] − dates[0]) / 24h) + 1 (+1 so "2 comps same day" = 1, not 0).4
Top 20 per milestone
9 GroupedStatistic sections, each sorted asc + top 20.
Caveats & edges
- "+1" makes same-day endpoints (theoretical 5 comps in a day) = 1 day not 0 — different from
competitions_per_year_by_personwhich uses precise 365.25. - Milestones output asc by count (5 → 300); UI displays the full spectrum.
- For 5-comp milestone, high-cadence cubers often back-to-back the same weekend — top 20 commonly 1-3 days.