Case Study 2 — The Opening-Mining Trap: How Big Must a Database Be?
Setup
Every club has someone like Dev: a player with a laptop, a few thousand games and a script that ranks openings by score. The ranking always produces a winner and a loser. The question this case study answers with real data is: at what database size does such a ranking start to mean anything?
We can answer it because the Lichess sample is large enough to be cut into pieces. The design (script code/case_study_02.py):
- Population: balanced Lichess games (|rating difference| ≤ 100), no bots, bullet to classical, in the 25 most common opening families — 2,616,530 games.
- The table being mined: opening family × rating band (8 bands, everything below 1200 merged) — 200 cells.
- Cell value: each game's rating-adjusted White score minus its band's average rating-adjusted score. This removes White's first-move edge, so 0 means "this opening does as well as the average opening at this level". A cell is "significant" if its mean is at least 1.96 standard errors from zero.
- The experiment: take random subsamples of 100%, 20%, 5%, 2% and 0.5% of the games (three seeds each for the subsamples), split each subsample into two random halves, and count how many cells are significant in half A and how many of those are significant with the same sign in half B. Cells need at least 60 games in each half to be tested.
With 200 cells, a Bonferroni correction for a 5% family-wise error rate needs |z| ≥ 3.66 — we report that too.
The data
means over seeds:
games cells sig_A expected_false replicate rep_rate r_AB bonf_A bonf_rep
100% 2,616,530 199.00 66.00 9.95 42.00 63.64% 0.33 15.00 15.00
20% 523,306 190.00 30.00 9.50 7.00 23.30% 0.21 1.67 1.00
5% 130,826 167.00 10.67 8.35 1.33 12.93% 0.07 0.67 0.33
2% 52,331 131.67 9.33 6.58 0.00 0.00% 0.02 0.00 0.00
0.5% 13,083 28.33 2.33 1.42 0.00 0.00% -0.15 0.00 0.00
(expected_false = 5% of the testable cells: the number of "significant" cells you would expect if no opening differed from any other.)

📊 Figure (described): Left: as the database grows from 13,000 to 2.6 million games, the number of cells significant in half A (red) rises from 2 to 66, and the number that replicate in half B (blue) rises from 0 to 42; the dotted line shows how many "significant" cells chance alone would produce. Right: the correlation between the two halves' cell values climbs from about zero (and slightly negative) for the small databases to 0.33 for the full one. Below about 130,000 games, the table is almost pure noise.
Analysis
Small databases produce findings at the rate of chance. With 52,331 games — more than most players' lifetime of online chess, and more than many published "opening reports" use — the mined table produced 9.3 significant cells on average, against 6.6 expected by chance alone. None of them replicated in the other half, in any of three random draws. The correlation between halves was 0.02: knowing a cell's value in one half told you nothing about it in the other.
The table only becomes informative in the hundreds of thousands. At 523,306 games (20%), 30 cells were significant and 7 replicated (23%); the half-to-half correlation was 0.21. At the full 2.6 million, 66 cells were significant and 42 replicated (64%), with r = 0.33. (Section 31.9 used a stricter minimum of 500 games per half and found r = 0.55 — the small, noisy cells pull the correlation down.)
A multiple-comparison correction is cheap insurance. With the Bonferroni threshold (|z| ≥ 3.66), the full data still produced 15 findings — and all 15 replicated. At 20% the threshold left one to three findings per draw (1.67 on average), and exactly one of them replicated in each draw. The correction throws away some real effects, but what survives is trustworthy.
What a small database "finds". Take one 2% subsample and look at a single band, 1600–1799, the way a club player would look at their own level:
band 1600-1799, family minus band average (rating-adjusted points)
2% sample (games) full data (games)
Bishop's Opening +6.51 (229) +0.99 (11,452)
Scotch Game +6.34 (287) +2.99 (14,718)
Horwitz Defense +5.43 (192) +0.95 (9,810)
Italian Game +4.65 (523) −0.18 (27,178)
King's Pawn Game +3.82 (310) +1.03 (14,650)
...
Modern Defense −2.99 (370) −0.10 (17,378)
Philidor Defense −3.36 (310) +0.49 (15,700)
Four Knights Game −3.81 (118) −0.11 (6,245)
Englund Gambit −4.77 (193) −1.50 (9,606)
Hungarian Opening −5.54 (212) −0.55 (10,686)
From 52,000 games, a 1600–1799 player would conclude that the Bishop's Opening and the Italian are White's best weapons (+6.5 and +4.7 points above the average opening) and the Hungarian and the Englund are disasters. The full data, with about fifty times as many games per cell, says the Bishop's Opening is +1.0, the Italian slightly below average (−0.2), the Hungarian −0.6. Only the Scotch's edge survives as a genuine effect, at roughly half the size the small sample suggested (+3.0), and the Englund's deficit shrinks to −1.5. Every number in the small-sample column is real arithmetic on real games; almost none of them is a property of the openings.
Why the curve has this shape: a back-of-envelope check
You can predict most of this from arithmetic before running anything. A single game's result is 1, ½ or 0, so (with few draws, as on Lichess) its standard deviation is close to half a point — about 50 percentage points. The standard error of a cell's mean score is therefore roughly 50/√n points:
| games in the cell | standard error (pts) | a "significant" difference must be at least |
|---|---|---|
| 100 | 5.0 | ±9.8 |
| 250 | 3.2 | ±6.2 |
| 1,000 | 1.6 | ±3.1 |
| 2,500 | 1.0 | ±2.0 |
| 10,000 | 0.5 | ±1.0 |
Now compare with the size of the real effects. In the full data, the strongest replicated cells (the ones listed in Section 31.9) are about 1 to 3.5 points in size — the Scotch's +3.0 at 1600–1799 is among the largest. A cell of 250 games cannot detect an effect of that size: anything it calls significant must be at least ±6 points, which is bigger than almost every real effect in the table — so what it detects is mostly noise. That is exactly the 2% subsample's behaviour (its 1600–1799 cells had 118 to 523 games). Real effects of one to three points need cells of a few thousand games each, which, multiplied by 200 cells, is why the table only becomes informative in the hundreds of thousands of games.
The same arithmetic applies to your own repertoire. Seventy games in one opening give a standard error of about 6 points; Dev's Italian (67.9%) was 15 points above the database's 52.7%, large enough to clear its interval. A 3-point difference — the size of most real opening effects — would need around 1,000 of your games in that one opening to show up reliably.
A protocol for mining a table
- Decide the cells before you look — the fewer the better. One band and five openings is a better question than eight bands and twenty-five openings.
- Compute the minimum cell size you need for the effect size you care about (the table above), and drop or merge smaller cells.
- Split before you sort. Look at half A only, list the findings, then check them in half B. Report how many replicated.
- Correct for the number of tests if you report more than a handful of cells.
- Shrink the extremes when you quote them: the replicated value from half B (or a pooled estimate pulled toward the average) is a better guess of the truth than the most extreme value you saw.
What it means (and doesn't)
- It means that opening "rankings" from a few thousand or even tens of thousands of games are mostly noise, and the top and bottom of any such ranking are the noisiest entries of all (regression to the mean). Your own games are a much smaller database than any of these.
- It means that a mined table needs a replication check before anyone acts on it — a split half, a second month of data, or a different pool (OTB vs online) — and that a multiple-comparison correction is worth its cost.
- It means cell sizes matter more than the total: a 2.6-million-game table can still have cells with a few hundred games (the 2400+ band, rarer families), and those cells behave like a small database.
- It does not mean big databases are always right. A finding that replicates in two halves of the same population can still be confounded (who chooses the opening, at which time control). Replication rules out noise, not bias; Section 31.3's rating adjustment and Section 31.4's position queries deal with the rest.
- It does not mean small samples are useless. They are useless for ranking twenty-five openings at once. For one pre-registered question ("does my Italian score above my band's 52.7%?") with an interval, a small sample can be informative — as Dev's 70 Italian games were.
Discussion questions
- Why did the half-to-half correlation for the 0.5% subsamples come out slightly negative (−0.15)? Is that evidence of anything?
- The Bonferroni correction treated all 200 cells as one family of tests. Would it be more sensible to correct within each band (25 tests) if you only care about your own level? What changes?
- The split here was by game. Section 31.9 also split by White player and found a higher correlation. Under what circumstances would a by-player split give a lower correlation than a by-game split — and what would that tell you about an opening's "effect"?
- If you could only afford to analyse 50,000 games, how would you redesign the question so that the answer is worth having? (Think: fewer cells, one band, one pre-specified comparison.)
Your turn
Run code/case_study_02.py with your own table: replace "opening family × band" by "opening family × speed" (bullet, blitz, rapid, classical) and keep the same subsample sizes. Report the same nine columns. Then answer in three sentences: at what database size does your table start to replicate, how does that compare with the family × band table, and why might speed cells behave differently from band cells (hint: look at how unevenly the games are spread across speeds — classical is 0.6% of the Lichess sample)? Finally, apply step 5 of the protocol: for your three most extreme cells, quote the half-B value next to the half-A value, and explain in one sentence why the half-B value is the one you would put in a repertoire report.