First record is a World Record
CinematicA cuber qualifies when their very first regional record (NR / CR / WR — WCA collectively calls these "regional records") was simultaneously a World Record.
Dramatic and rare: most cubers stair-step from NR → CR → WR; only prodigies or competitors in niche events skip straight to WR on debut.
By the numbers
ROW_NUMBER()
First-only pick
Window-rank by start_date
rn = 1
Filter
Keep first-record-per-person only
single ∪ average
Both metric types
UNION ALL, then window-rank together
`record = WR`
Inclusion
First record is a WR
Data source
UNION ALL the two subsets (regional_single_record IS NOT NULL and regional_average_record IS NOT NULL) — each row carries start_date and the record type (NR / CR / WR). A window function ROW_NUMBER() OVER (PARTITION BY person_id ORDER BY start_date) numbers each person's records chronologically; keep rn = 1.
Final WHERE record = 'WR' filters to those whose first record happened to be a WR.
sql
SELECT *, ROW_NUMBER() OVER (
PARTITION BY person_id ORDER BY start_date
) AS rn
FROM (
SELECT person_id, event_id, 'single' AS type,
best AS result, regional_single_record AS record, ...
FROM results WHERE regional_single_record IS NOT NULL
UNION ALL
SELECT ..., 'average', average, regional_average_record, ...
FROM results WHERE regional_average_record IS NOT NULL
) all_records
WHERE rn = 1 AND record = 'WR'Algorithm / pipeline
1
Pool all regional records
Both
regional_single_record and regional_average_record columns (NR / CR / WR / null) become rows when non-null.2
Window-rank per person by date
ROW_NUMBER() OVER (PARTITION BY person_id ORDER BY start_date) numbers each cuber's record events 1, 2, 3, ... chronologically.3
Keep `rn = 1`
Keep only each person's earliest regional record; multiple records on the same date all qualify as "first".
4
Filter `record = WR`
From the first-record set, keep only those tagged WR — that's the leaderboard.
Caveats & edges
- "First" is
start_dateordering; same-day records (multiple comps, or single + average flagged together) all tie forrn = 1. - Any non-empty
regional_*_recordvalue counts (NR / CR / WR all enter the UNION before the WR filter). - WCA's
regional_*_recordmarkers are stamped at time-of-record and stay there even after the WR is broken — historical WRs are never "demoted".