Skip to content

fix: bound semantic keyset scans - #280

Merged
acidkill merged 1 commit into
mainfrom
fix/semantic-keyset-range
Sep 25, 2026
Merged

acidkill merged 1 commit into
mainfrom
fix/semantic-keyset-range

Conversation

@acidkill

Copy link
Copy Markdown
Owner

Summary

  • Read neuron and synapse keyset pages through bounded, ordered record-ID windows.
  • Preserve cursor exclusivity, brain/time filters, and full-page behavior across window boundaries.
  • Cover numeric-only and underscore-prefixed IDs with live SurrealDB 3.2.4 plan/parity regressions.

Why

SurrealDB 3.2 was scanning the full remaining suffix of neuron/synapse tables for each keyset page. A single open-ended record range changed the operator to RecordIdScan but still visited most of the suffix. These bounded adjacent leading-character ranges cap each scan interval; the original exclusive ID predicate remains authoritative, and pages continue into the next interval when the prior one has too few matching rows.

Test plan

  • pytest tests/ -m "not stress" -n auto passes locally (7,748 passed, 179 skipped, 1 xfailed).
  • ruff check src/ tests/ clean.
  • ruff format --check src/ tests/ clean.
  • mypy src/ --ignore-missing-imports clean.
  • Disposable local SurrealDB 3.2.4: returned-ID parity, multi-brain/reference-time filters, unusual IDs, page fill across windows, and EXPLAIN FULL RecordIdScan.

Verified by

@acidkill.

@acidkill
acidkill merged commit 9b6cdc3 into main Sep 25, 2026
9 checks passed
@acidkill
acidkill deleted the fix/semantic-keyset-range branch September 25, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant