docs: query comments say what each query selects and why, not how it came to be (#6277)
Rewrites the internal/db/queries comments to rule 32 and regenerates dbq, whose doc comments and embedded SQL carry them. The bugs behind the tiered mixes, the md5 order seed, the score bands and the round-robin arms are restated as the constraint each one enforces; counts from one library and stale cross-references are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
-- ListenBrainz has never answered for, or not in 30 days. Never-fetched first,
|
||||
-- then the oldest answer. Freshness is read from track_similarity_fetches, not
|
||||
-- from the edges, so a seed whose answer matched nothing in the library still
|
||||
-- counts as fetched (#5296); reading the edges is what let 25 such seeds hold
|
||||
-- the head of the queue forever.
|
||||
-- counts as fetched; reading the edges would let such seeds hold the head of
|
||||
-- the queue forever.
|
||||
SELECT t.id, t.mbid
|
||||
FROM tracks t
|
||||
LEFT JOIN track_similarity_fetches f ON f.track_id = t.id
|
||||
@@ -70,9 +70,9 @@ ON CONFLICT (artist_id) DO UPDATE SET fetched_at = now(), returned = EXCLUDED.re
|
||||
--
|
||||
-- The score is RELATIVE: each edge's LB score over the seed's best score in its
|
||||
-- whole cached answer, so 1.0 is the seed's closest recording and the rest fall
|
||||
-- below it (#6177). LB's raw scores are counts (16 to 1445 on the operator's
|
||||
-- library) and reached the scorer, which reads similarity as 0 to 1, so one
|
||||
-- edge outweighed likes, skips and recency together. The cache keeps the raw
|
||||
-- below it. LB's raw scores are counts, into the thousands, and the scorer
|
||||
-- reads similarity as 0 to 1, so a raw edge would outweigh likes, skips and
|
||||
-- recency together. The cache keeps the raw
|
||||
-- answer; only the edge is scaled.
|
||||
--
|
||||
-- Only edges of seeds the cache owns are removed, those with a fetch row.
|
||||
|
||||
Reference in New Issue
Block a user