voyager 3: release_texts, the searchable strings of a release (migration 6200)
One table and one trigram index for every string search matches against: the release name (kind 1, stored once more) and what anyone learns later (the prober's file names inside an archive, NFO titles, par2 set names, media titles), appended by insert, never an update of the releases row. Kinds and the per-kind cap in lib/release/text_kind.ts (textsToStore). The judge's dirty mark follows an insert or delete. Migration 6000 loses its two trigram indexes on releases. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
346493b6c3
commit
bc4e17e86f
5 files changed
+161
-13
No files matched your search
+23
-6
@@ -493,11 +493,27 @@ releases; the inspector matches them again), `nntp_shares`, `nodes`,
|
||||
`edge` (open at its block's end); `release_key` and `identity_key` as
|
||||
20-byte `bytea`; `name`, `inner_name`. Gone: `poster`, `groups`,
|
||||
`last_seen_at`. Indexes: pkey, release_key unique, (identity_key,
|
||||
group_id), name and inner-name trigram, newest, (poster_id, newest),
|
||||
passworded, `(group_id, identity_key) WHERE edge` for the block merger,
|
||||
`id WHERE settled_at IS NULL` for the provisional ones. The category
|
||||
trigger reads the groups from `group_sets`; the judge's dirty trigger
|
||||
watches `poster_id` instead of `poster`.
|
||||
group_id), newest, (poster_id, newest), passworded, `(group_id,
|
||||
identity_key) WHERE edge` for the block merger, `id WHERE settled_at IS
|
||||
NULL` for the provisional ones. No trigram indexes: search matches
|
||||
`release_texts`. The category trigger reads the groups from
|
||||
`group_sets`; the judge's dirty trigger watches `poster_id` instead of
|
||||
`poster`.
|
||||
- `release_texts(release_id, kind smallint, text varchar(255))` (6200),
|
||||
primary key on all three, one trigram index (fastupdate): every string
|
||||
search matches against, appended by whoever learns one and never an
|
||||
update of the releases row. Kinds (`lib/release/text_kind.ts`): 1 name
|
||||
(the release name, stored once more so one index serves everything),
|
||||
2 file (the prober's names inside an archive), 3 nfo (an NFO's title),
|
||||
4 par2 (a set's name), 5 media (a container's title); at most 20 per
|
||||
release and kind (`textsToStore`). A repeat insert is a no-op; the
|
||||
judge's dirty mark follows an insert or delete, so a rule can react to a
|
||||
name arriving later. Search: the trigram index yields release ids, joined
|
||||
to `releases` by primary key (never an OR across the two tables, which
|
||||
the planner cannot serve from indexes). `inner_name` stays on `releases`
|
||||
as the one display string. Facets to filter on (resolution, codec,
|
||||
language) are not texts: columns, or a `meta jsonb` with a
|
||||
`jsonb_path_ops` index once one is proven useful.
|
||||
- `posters(id serial, poster unique)` with its trigram index;
|
||||
`group_sets(id serial, groups jsonb unique)`, a sorted array of names.
|
||||
- `blocks` (6100): `group_id`, `start_id`, `end_id`, `next_id` (the resume
|
||||
@@ -516,7 +532,8 @@ releases; the inspector matches them again), `nntp_shares`, `nodes`,
|
||||
the judge must read it by release or keep what it needs on the NVMe.
|
||||
|
||||
Next: the batch store (write-once releases, posters and group sets by id,
|
||||
bytea keys, blocks), then the window and albums in the Rust edge, block
|
||||
bytea keys, blocks, the name into `release_texts`), then the window and
|
||||
albums in the Rust edge, block
|
||||
leases and the block merger, the corpus replay harness. Until the batch
|
||||
store is done the 38 functional tests that write the old columns fail on
|
||||
`voyager-3`.
|
||||
|
||||
Reference in new issue
Block a user