Skip to content
This repository was archived by the owner on Sep 29, 2026. It is now read-only.

Decode each unordered table-scan row once. - #120

Merged
jepsontaylor merged 1 commit into
mainfrom
perf/one-pass-scan
Sep 25, 2026
Merged

jepsontaylor merged 1 commit into
mainfrom
perf/one-pass-scan

Conversation

@jepsontaylor

Copy link
Copy Markdown
Collaborator

Summary

An unordered table scan decoded every visible row and threw that row away, then decoded the survivors again while applying WHERE and the select list. It now keeps the first load. LIMIT and OFFSET still run on the static batch that already honors them. A point lookup and an index probe still fetch by rowid, because those paths never decoded the heap row twice. The optional routed scan uses the same single load when REDLINE_MORSEL_ROUTE is set. It stays off by default.

Join order and LIMIT 1 stay locked by ci_safe_order. No speed ratio is claimed.

Claim: AGENT_CHAT.md 2026-09-25T19:10Z perf/one-pass-scan.

Acceptance: cargo test -p redlinedb-sql --offline --test ci_safe_order --test smoke_select. Local just pr-ci exited 0 (/tmp/redline-pr-ci-scan.log).

Parent: 1e21f23caa5842ca2469ec444a6edc4ac4bf36fa.

The heap scan used to load every visible row to drop it, then load the survivors again while projecting. It now keeps that first load, applies WHERE, and projects into the static batch that already honors LIMIT and OFFSET. Point and index probes still fetch by rowid. The routed scan, when enabled, uses the same single load.

Claim: AGENT_CHAT.md 2026-09-25T19:10Z perf/one-pass-scan.
Acceptance: cargo test -p redlinedb-sql --offline --test ci_safe_order --test smoke_select

@neverhumanbot neverhumanbot left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unordered table scans keep the visibility load instead of decoding the row again. Index probes stay rowid lookups. Required, audit, official parity, evidence guard, and packaging succeeded on edd6aa8.

@jepsontaylor
jepsontaylor merged commit 4c622a4 into main Sep 25, 2026
31 checks passed
@jepsontaylor
jepsontaylor deleted the perf/one-pass-scan branch September 25, 2026 19:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants