Cache projected range aggregate scans #10

Open
ober wants to merge 1 commit from optimize-table-range-aggregate into optimize-unchanged-index-update
Owner

Cache projected single-column table scans for repeated count(*), avg(column) range aggregates. The cache is keyed by scan object plus database bytevector identity, change counter, table root, and physical column, so writes invalidate it.\n\nVerification:\n- make build\n- GERBIL_LOADPATH="/Users/user/mine/gerbil-sqlite:/Users/user/mine/gerbil-sqlite/.gerbil/lib:/Users/user/mine/gerbil-sqlite/gerbil-compat:/Users/user/mine/gerbil-sqlite/gerbil-compat/.gerbil/lib" timeout 240 /opt/gerbil/bin/gerbil env gxi tests/unit/test-api.ss\n- GERBIL_LOADPATH="/Users/user/mine/gerbil-sqlite:/Users/user/mine/gerbil-sqlite/.gerbil/lib:/Users/user/mine/gerbil-sqlite/gerbil-compat:/Users/user/mine/gerbil-sqlite/gerbil-compat/.gerbil/lib" timeout 240 /opt/gerbil/bin/gerbil env gxi tests/unit/test-exec.ss\n- mixed-type fallback probe for count/avg range\n- N=1000 make bench-compiled\n- N=1000 make bench-prepared-compiled\n- N=10000 make bench-prepared-compiled\n- make binary && make smoke\n\nMeasured results:\n- N=1000 prepared range SELECT: 4.07 ms vs SQLite 2.77 ms, 1.5x slower\n- N=1000 prepared total: 36.31 ms vs SQLite 6.44 ms, 5.6x slower\n- N=10000 prepared range SELECT: 28.68 ms vs SQLite 23.72 ms, 1.2x slower\n- N=10000 prepared total: 337.83 ms vs SQLite 59.06 ms, 5.7x slower\n- regular benchmark total: 536.30 ms vs SQLite 248.76 ms, 2.2x slower

Cache projected single-column table scans for repeated count(*), avg(column) range aggregates. The cache is keyed by scan object plus database bytevector identity, change counter, table root, and physical column, so writes invalidate it.\n\nVerification:\n- make build\n- GERBIL_LOADPATH="/Users/user/mine/gerbil-sqlite:/Users/user/mine/gerbil-sqlite/.gerbil/lib:/Users/user/mine/gerbil-sqlite/gerbil-compat:/Users/user/mine/gerbil-sqlite/gerbil-compat/.gerbil/lib" timeout 240 /opt/gerbil/bin/gerbil env gxi tests/unit/test-api.ss\n- GERBIL_LOADPATH="/Users/user/mine/gerbil-sqlite:/Users/user/mine/gerbil-sqlite/.gerbil/lib:/Users/user/mine/gerbil-sqlite/gerbil-compat:/Users/user/mine/gerbil-sqlite/gerbil-compat/.gerbil/lib" timeout 240 /opt/gerbil/bin/gerbil env gxi tests/unit/test-exec.ss\n- mixed-type fallback probe for count/avg range\n- N=1000 make bench-compiled\n- N=1000 make bench-prepared-compiled\n- N=10000 make bench-prepared-compiled\n- make binary && make smoke\n\nMeasured results:\n- N=1000 prepared range SELECT: 4.07 ms vs SQLite 2.77 ms, 1.5x slower\n- N=1000 prepared total: 36.31 ms vs SQLite 6.44 ms, 5.6x slower\n- N=10000 prepared range SELECT: 28.68 ms vs SQLite 23.72 ms, 1.2x slower\n- N=10000 prepared total: 337.83 ms vs SQLite 59.06 ms, 5.7x slower\n- regular benchmark total: 536.30 ms vs SQLite 248.76 ms, 2.2x slower
Cache projected range aggregate scans
All checks were successful
ci / test (push) Successful in 3s
ci / test (pull_request) Successful in 3s
8cf1b4ecec
All checks were successful
ci / test (push) Successful in 3s
ci / test (pull_request) Successful in 3s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin optimize-table-range-aggregate:optimize-table-range-aggregate
git switch optimize-table-range-aggregate

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch optimize-unchanged-index-update
git merge --no-ff optimize-table-range-aggregate
git switch optimize-table-range-aggregate
git rebase optimize-unchanged-index-update
git switch optimize-unchanged-index-update
git merge --ff-only optimize-table-range-aggregate
git switch optimize-table-range-aggregate
git rebase optimize-unchanged-index-update
git switch optimize-unchanged-index-update
git merge --no-ff optimize-table-range-aggregate
git switch optimize-unchanged-index-update
git merge --squash optimize-table-range-aggregate
git switch optimize-unchanged-index-update
git merge --ff-only optimize-table-range-aggregate
git switch optimize-unchanged-index-update
git merge optimize-table-range-aggregate
git push origin optimize-unchanged-index-update
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ober/gerbil-sqlite!10
No description provided.