Repository navigation
Conversation
Let callers predict the list count a rebuild would target without copying the sizing rule into SQL. Validate index settings and bound large row counts before the shared calculation narrows them.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the SQL list-count sizing helper.
No open issues 🎉
What changed in this PR
Exposes PRISM’s shared automatic list-count calculation through SQL, allowing callers to estimate rebuild sizing without duplicating the formula.
Changes:
- Adds
prism_auto_nlist(row_count, dim, target_pages)to fresh installs and upgrades. - Validates dimensions and page targets, and safely caps large row counts.
- Documents usage and adds regression cases for sizing, limits, invalid inputs, and NULL handling.
| File | Description |
|---|---|
test/pg/sql/inspect.sql |
Adds automatic-sizing regression cases. |
test/pg/expected/inspect.out |
Records expected sizing results and validation errors. |
src/pg/build.c |
Adds the SQL-callable wrapper with validation and overflow protection. |
sql/pg_vectorsearch.sql |
Registers the helper for fresh installations. |
sql/pg_vectorsearch--0.2.0--0.3.0-dev.sql |
Registers the helper during upgrades. |
README.md |
Introduces the sizing helper and its optional argument. |
docs/tuning.md |
Explains target sizing, bounds, and differences from built list counts. |
Review effort: Balanced
CoverageTotal coverage: 92% |
jgpruitt
approved these changes
Dec 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Let callers predict the list count a rebuild would target without copying the sizing rule into SQL. Validate index settings and bound large row counts before the shared calculation narrows them.
Closes #406