Skip to content

create_vector_index: describe mutations_before_rebuild as the floor it is - #111

Merged
tae898 merged 1 commit into
mainfrom
fix/110-mutations-before-rebuild-floor
Oct 28, 2026
Merged

tae898 merged 1 commit into
mainfrom
fix/110-mutations-before-rebuild-floor

Conversation

@tae898

@tae898 tae898 commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Closes #110

create_vector_index documented mutations_before_rebuild as an override with suggested ranges (100-300, 300-800). The engine uses it as a floor: the graph is rebuilt after max(mutationsBeforeRebuild, min(graph size x rebuildGraphRatio, maxPendingMutations)) changes (LSMVectorIndex.computeRebuildThreshold, defaults 100, 0.2 and 50,000; the same formula on 26.10.1, 26.10.2 and current main), so values below the ratio term change nothing.

  • src/arcadedb/core.py: the docstring gives the formula, the defaults, a worked example (100,000 vectors: 20,000 whether the floor is 100 or 800), and the setting that lowers the threshold (rebuildGraphRatio; with the ratio at 0 the threshold is exactly the floor). No behaviour change.

  • tests/test_vector_index_introspection.py: TestRebuildThreshold pins the floor on both wheels through get_stats()["effectiveMutationsThreshold"] on a 1,000-vector index: floors 10 and 100 give 200, 5,000 gives 5,000.

Checked locally: black 26.10.1 and isort 9.0.2 (the pre-commit pins), bandit (no issues), compile and pyflakes. The test runs in CI.

🤖 Generated with Claude Code

…t is (#110)

The engine rebuilds after max(mutationsBeforeRebuild, min(graph size x rebuildGraphRatio,
maxPendingMutations)) changes (LSMVectorIndex.computeRebuildThreshold, the same on 26.10.1,
26.10.2 and main), so the old docstring's 'override' and its 100-800 ranges had no effect past
a few thousand vectors. The docstring now gives the formula, the defaults, and the setting that
does lower the threshold (rebuildGraphRatio). A regression test pins the floor through
get_stats()['effectiveMutationsThreshold'] on a 1000-vector index: floors 10 and 100 give 200,
5000 gives 5000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tae898
tae898 merged commit 1900784 into main Oct 28, 2026
36 checks passed
@tae898
tae898 deleted the fix/110-mutations-before-rebuild-floor branch October 28, 2026 09:57
tae898 added a commit to humemai/arcadedb-embedded-python that referenced this pull request Oct 28, 2026
…550)

The engine computes max(mutationsBeforeRebuild, min(graph size x rebuildGraphRatio,
maxPendingMutations)) in 26.10.1, 26.10.2 and main (computeRebuildThreshold, read from the
database configuration), so the "override" wording and the 26.10.1 workaround "a lower
mutations_before_rebuild" were wrong past 500 vectors. The guide now gives the formula and the
ALTER DATABASE route for rebuildGraphRatio (main c3af6d9: 1,000 to 250 at 5,000 vectors).
Same fix as ArcadeData/arcadedb-python#111 and #113.

Closes #549

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

create_vector_index: mutations_before_rebuild is a floor of the rebuild threshold, not an override

1 participant