Back to WCA Statistics

Shortest time to N comps milestone

Person

One 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_date

Algorithm / 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

Related stats & links