Skip to content

Use ranked scans for generic prepared search queries - #32

Merged
bweis merged 17 commits into
mainfrom
perf/generic-ranked-plans
Sep 19, 2026
Merged

bweis merged 17 commits into
mainfrom
perf/generic-ranked-plans

Conversation

@bweis

@bweis bweis commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Generic prepared searches retain a text parameter, which previously prevented the ranked custom scan from being offered. Bind external query parameters when the ranked scan executes, and clear/rebind state on rescans. NULL returns no matches; malformed executions and changing parameters preserve normal error and scoring behavior.

Four alternating before/after trials on a fixed 1,000-document Wikipedia prefix, all 906 trace forms, force_generic_plan, 2 clients, 4 CPUs/4 GiB completed with membership and exhaustive ranked checks passing. Median QPS increased 27.1 → 6,301.2; median p95 decreased 79.109 → 0.714 ms. The paired throughput ratio was 232.208x (range 231.692–232.723x). This is a small-corpus forced-generic diagnostic, not capacity or automatic-plan performance; trials predate explicit visibility-map capture. Full protocol, source/image identities, and limitations are retained in docs/benchmarks/generic-ranked-plans.md and generic-ranked-results.json.

Validation: PostgreSQL 17/18 on x86-64/ARM64 and upstream Lead oracle passed at the measured implementation 7d441c1. Reporting/stack integration now passes 122 Python tests and 171 source-header checks; CI reruns on the final head. Parameterized LIMIT bounds are handled separately in PR36.

@bweis
bweis added this pull request to stack #33 September 19, 2026 20:34
Base automatically changed from bench/million-memory-pressure to main September 19, 2026 22:50
@bweis
bweis force-pushed the perf/generic-ranked-plans branch from 7d441c1 to eefb723 Compare September 19, 2026 22:50
… perf/generic-ranked-plans

# Conflicts:
#	docs/benchmarks/generic-ranked-plans.md
@bweis
bweis marked this pull request as ready for review September 19, 2026 22:52
@bweis
bweis merged commit f7d6494 into main Sep 19, 2026
18 checks passed
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