Liner notes How this works Back to the record

Work in progress I'm still writing this page. The steps and numbers are right, but the words are a first draft.

01

Where the numbers come from

Everything on the record starts with the monthly Discogs data dump, which is the whole catalogue under CC0, and the CSV export of my own collection. ClickHouse does the rest. Every number on the page comes out of a SQL query you can open, and, if you connect a ClickHouse of your own, run again.

  1. Discogs data dump12.7 GB of gzipped XML: 19.6M releases, 10.3M artists, 2.6M albums, 2.4M labels
  2. discogskitturns the XML into flat Parquet in about six minutes, sub-tracks and all
  3. ClickHouseINSERT … SELECT FROM file() loads it into MergeTree in about 40 seconds: 252M credits, 182M tracks, 67M person-to-album edges
  4. My shelfthe Discogs collection export, loaded alongside
  5. Buildruns every query on the page and writes the results to static files, in about 20 seconds
  6. This pagestatic HTML on GitHub Pages. No server, unless you bring one
02

What runs when

Once a month
Download the dump, convert it, load it. Discogs publishes a full snapshot each month rather than changes, so the whole thing gets rebuilt. It's cheap enough that this is fine.
Once per build, with AI
ClickHouse's AI functions run once, at build time, and never on the live page. aiClassify sorts the ways Discogs describes vinyl colour into plain colours. Limited vinyl since 2015 alone has 85,688 different phrases, and it has done 2,058 of them so far (the 2,000 most common, plus the ones on my shelf), about 95% right on a random check. aiGenerate writes the short notes about the people on my shelf. For now that's a small model on my laptop through Ollama. On ClickHouse Cloud it'll be the same SQL with a bigger one.
Every time you open the page
Nothing touches a database. The numbers are baked in from the last build.
When you press Run live
The page sends the exact query from that panel to my ClickHouse Cloud service, as a read-only user, or to a ClickHouse you connect yourself. It shows what came back and how long it took, and you can edit the SQL first.
Covers
Most covers are already on the page, because the build finds them on the Cover Art Archive through MusicBrainz, once per record. For the rest, the page asks the Discogs API as each sleeve scrolls into view, keeps the cover for under six hours as their terms ask, and credits Discogs on it.
03

Where ClickHouse earns its keep

All of this runs on my laptop. Working out whether vinyl is mostly old albums again (B1) reads a summary table that the load builds once from 22 million rows, so it takes milliseconds. The colour chart matches the colour description of every vinyl pressing against the list the AI sorted at build time, which is 40 million rows and about a tenth of a second too. Finding the people on my shelf goes through 252 million credits in a third of a second, and what to buy next reads 125 million rows in a quarter. The running time on the hidden track comes out of 182 million tracks.

04

Run it yourself

You need clickhouse, discogskit, and your own Discogs collection export in the repo root. Then:

./build.sh --dump 20261101   # first time: download and load the dump
./build.sh                   # after that: rebuild the page
./dev/live.sh                # optional: a local server for Run live

With ./dev/live.sh running, press Run live and connect to http://localhost:8123 as web, password vinyl-local.