pub const CREATE_INDICES: &[&str];Expand description
Every index the schema declares.
§Two entries left in v8, and why the list is now allowed to be short
idx_annotations_label and idx_lc_tgt_active were dropped by the v7 → v8
rung (D-089, completed by
D-118). Neither had a reader anywhere in the crate — analytics_annotations
is never selected from here at all, and no query seeks on
links_current.target_id as a leading column — so each was an index write
per insert, forever, buying nothing. One of them was on the crate’s hottest
write path.
tests/index_plan_tests.rs now requires the unread set to be empty,
which turns “these two are known bad” into “an index with no reader is a red
test”. That is the guarantee this list is kept short by.
§idx_links_target is not idx_lc_tgt_active coming back
The two look like the same index and are not, which is worth stating because
the resemblance is the trap. idx_lc_tgt_active was (target_id, valid_to)
on links_current, the materialized projection, and it was dropped
because nothing in the crate seeks on it — no reader, pure write cost.
idx_links_target is (target_id) on links, the ledger, and it exists
because CONCEPTS_ARCHIVABLE seeks on exactly that column and the plan is
measured before and after.
D-089’s rule was never “no index on a target column”. It was “an index needs a named query that seeks on it”, and the registry is what enforces the difference rather than this paragraph.