Source: Audit doc /tmp/krl-quandle-tangle-audit-2026-06-01.md DB-3.
Claim
Queries that filter by colouring_count_3, colouring_count_5, or alexander_polynomial (and after the polynomial-extension issue lands: Jones, Conway, HOMFLY) should hit a secondary index, not table-scan the knot table.
Why valuable
Currently find where colouring_count_3 = p and crossing < 8 scans the whole semantic index table. For O(10^4)+ knots this becomes the bottleneck of every multi-filter query.
A B-tree or hash index on these fingerprint columns turns it into O(log n) lookup.
Architecture position
Storage lives in Skein.jl. QuandleDB queries the semantic index it populates. The index lives in Skein.jl too. So this issue is upstream-blocked on Skein.jl exposing index-creation primitives.
Acceptance criteria
Phase A — audit (in this repo)
Phase B — Skein.jl extension (upstream)
Phase C — QuandleDB consumption
Phase D — verification
Effort
- Phase A: 4h.
- Phase B: 1w upstream PR review cycle.
- Phase C: 1d.
- Phase D: 4h benchmark + property tests.
Out of scope
- Composite indexes (multi-column). Phase E.
- Full-text indexes on
canonical_presentation or polynomial strings. Phase F.
- Materialised views. Different concern entirely.
Cross-references
- Audit doc DB-3, DB-7 (cost-based query rewriting depends on this).
- Skein.jl issue tracker — open a corresponding tracker there for Phase B.
Source: Audit doc
/tmp/krl-quandle-tangle-audit-2026-06-01.mdDB-3.Claim
Queries that filter by
colouring_count_3,colouring_count_5, oralexander_polynomial(and after the polynomial-extension issue lands: Jones, Conway, HOMFLY) should hit a secondary index, not table-scan the knot table.Why valuable
Currently
find where colouring_count_3 = p and crossing < 8scans the whole semantic index table. For O(10^4)+ knots this becomes the bottleneck of every multi-filter query.A B-tree or hash index on these fingerprint columns turns it into O(log n) lookup.
Architecture position
Storage lives in
Skein.jl. QuandleDB queries the semantic index it populates. The index lives in Skein.jl too. So this issue is upstream-blocked on Skein.jl exposing index-creation primitives.Acceptance criteria
Phase A — audit (in this repo)
find where ... = ...filters acrossserver/serve.jlroute handlers andserver/krl/SqlFrontend.jl.Phase B — Skein.jl extension (upstream)
Skein.jlexposingcreate_index!(db, table, column, index_kind)anddrop_index!(db, table, column).index_kindper data type (B-tree for numeric, hash for string).Phase C — QuandleDB consumption
serve.jlstartup, ensure the canonical indexes exist (create-if-missing).find wherequery execution, prefer the indexed path.--no-indexenv knob for benchmark comparison.Phase D — verification
find where colouring_count_3 = 9on a 10⁴-knot table before vs after.Effort
Out of scope
canonical_presentationor polynomial strings. Phase F.Cross-references