Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
260c942
exec: hash join build memory counters (steady reservation, arena byte…
techgopal Nov 7, 2026
2f6db8c
exec: finalize-copy and coalesce-copy maxima among the build counters…
techgopal Nov 7, 2026
59b0606
exec: coalesce's merged-run bytes tested; build counter docs name wha…
techgopal Nov 7, 2026
eee345a
exec, session: build counter docs name get_array_memory_size; the cou…
techgopal Nov 7, 2026
7bb3c56
Merge remote-tracking branch 'origin/main' into p2b/opus1-x3-build-bytes
techgopal Nov 7, 2026
55c9059
exec: a hash join build's arena reads its chunks in place, no concate…
techgopal Nov 7, 2026
27b97f4
Merge remote-tracking branch 'origin/main' into p2b/opus1-x3-build-bytes
techgopal Nov 7, 2026
d0bb25e
Merge origin/main into p2b/opus1-x3-build-bytes; the TPC-H EXPLAIN AN…
techgopal Nov 7, 2026
160c9f8
Merge branch 'p2b/opus1-x3-build-bytes' into p2b/opus1-x3-copy-free
techgopal Nov 7, 2026
a66923e
exec: finalize's copy plumbing removed (build_need reserves the index…
techgopal Nov 7, 2026
5951fdb
exec: a join arena finds a row's chunk through a block table (4 bytes…
techgopal Nov 7, 2026
ab45aa5
exec: a join arena in blocks of 2^14 rows (X3' step 3 option C): a ro…
techgopal Nov 7, 2026
3b409cf
exec: option C funds each partition's tail copy as main did (a spilli…
techgopal Nov 7, 2026
2f30bf2
exec: a spilling join build reserves the kept tails with the indexes,…
techgopal Nov 8, 2026
8de4951
exec: a join table whose every key occurs once ends each chain withou…
techgopal Nov 8, 2026
27b2579
exec: a built join table keeps reserved what its arena holds (study 2…
techgopal Nov 8, 2026
7fcd46c
exec: review of the arena true-up: an index past its estimate keeps t…
techgopal Nov 8, 2026
a4a089b
exec: a salted join directory is the next power of two of 5/4 of its …
techgopal Nov 8, 2026
8a32d02
optimizer, common: a dimension's payload joins above the semi and ant…
techgopal Nov 9, 2026
202a936
Merge remote-tracking branch 'origin/main' into p2b/opus1-dimension-p…
techgopal Nov 9, 2026
a336ce5
optimizer, session: LatePayloadJoin re-check nits: every move gets it…
techgopal Nov 9, 2026
624cd92
exec: q18 physical plan snapshot takes LatePayloadJoin's plan (c_name…
techgopal Nov 9, 2026
dcdf2ec
Merge origin/main into the S5 stack: the idle-build spill writes the …
techgopal Nov 13, 2026
4721175
Merge LatePayloadJoin (p2b/opus1-dimension-payload-late) into the S5 …
techgopal Nov 13, 2026
345a499
Merge remote-tracking branch 'origin/main' into p2b/perf2-s5-stack
techgopal Nov 13, 2026
bdfe2cc
Merge remote-tracking branch 'origin/main' into p2b/perf2-s5-stack
techgopal Nov 13, 2026
47eb83c
exec: a salted directory takes 5/4 of its keys rounded up, so it neve…
techgopal Nov 14, 2026
8739b40
exec: a join build merges its tiny chunks before the block cut, so fi…
techgopal Nov 14, 2026
2dd5875
exec, common: a join build cuts blocks before merging its tiny chunks…
techgopal Nov 14, 2026
5c06617
docs: config reference follows the krishiv.deterministicOrder doc
techgopal Nov 14, 2026
6464279
Merge remote-tracking branch 'origin/main' into p2b/perf2-s5-stack
techgopal Nov 14, 2026
e04bda8
exec: a join build's block cut keeps the chunks held past the block
techgopal Nov 14, 2026
17a690a
optimizer: LatePayloadJoin collects a candidate only below a non-inne…
techgopal Nov 14, 2026
32a3ff4
changelog: fragment for #749
techgopal Nov 14, 2026
82f87f8
Merge origin/main (#734) into p2b/perf2-s5-stack
techgopal Nov 14, 2026
dff914d
Merge remote-tracking branch 'origin/main' into p2b/perf2-s5-stack
techgopal Nov 14, 2026
2d7279c
Merge branch 'main' into p2b/perf2-s5-stack
techgopal Nov 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.d/749.performance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Hash joins keep their build side in fixed-size row blocks with a smaller, denser hash directory, and a join's
unused columns are joined in only after the filtering joins above it: TPC-H q21 at scale factor 1000 runs in
277 s instead of 474 s with no spill (laptop, cold run).
7 changes: 5 additions & 2 deletions crates/krishiv-common/src/config/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ pub use lakehouse::{
CATALOG_MAX_COLUMNS, CATALOG_MAX_METADATA_BYTES, CATALOG_REQUEST_TIMEOUT, DELTA_LOG_THREADS,
};
pub use optimizer::{
EXPERIMENTAL_GROUP_KEY_CODE_FORCE, GROUP_KEY_CODE, SHARE_REPEATED_SUBTREES, SUBQUERY_AS_WINDOW,
EXPERIMENTAL_GROUP_KEY_CODE_FORCE, GROUP_KEY_CODE, LATE_PAYLOAD_JOIN, SHARE_REPEATED_SUBTREES,
SUBQUERY_AS_WINDOW,
};
pub use result_cache::{RESULT_CACHE_ENABLED, RESULT_CACHE_MAX_BYTES, RESULT_CACHE_TTL};
pub use server::{
Expand Down Expand Up @@ -97,6 +98,7 @@ pub static REGISTRY: &[&ConfigEntry] = &[
&RESULT_CACHE_TTL,
&RESULT_CACHE_MAX_BYTES,
&SUBQUERY_AS_WINDOW,
&LATE_PAYLOAD_JOIN,
&GROUP_KEY_CODE,
&EXPERIMENTAL_GROUP_KEY_CODE_FORCE,
&SHARE_REPEATED_SUBTREES,
Expand Down Expand Up @@ -798,7 +800,8 @@ pub static DETERMINISTIC_ORDER: ConfigEntry = ConfigEntry {
seed, so an operator that spills splits its rows the same way on every run. Costs \
parallelism where it falls back to one driver: meant for reproducing a result, \
comparing two builds, and tests. Memory pressure from other queries in the process \
can still change when an operator spills, and so the order of what it returns. The \
can still change when an operator spills, or whether a hash join build copies its \
rows into blocks as they arrive, and so the order of what it returns. The \
branches of a `UNION ALL` under an operator that must see all of them (a hash join \
probing a union) take turns in branch order, so they lose their overlap too. Off by \
default.",
Expand Down
1 change: 1 addition & 0 deletions crates/krishiv-common/src/config/registry/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ pub static INDEX: &[(&str, &ConfigEntry)] = &[
"krishiv.memory.reservationQuantum",
&MEMORY_RESERVATION_QUANTUM,
),
("krishiv.optimizer.latePayloadJoin", &LATE_PAYLOAD_JOIN),
(
"krishiv.python.worker.executables",
&PYTHON_WORKER_EXECUTABLES,
Expand Down
17 changes: 17 additions & 0 deletions crates/krishiv-common/src/config/registry/optimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,23 @@ pub static SHARE_REPEATED_SUBTREES: ConfigEntry = ConfigEntry {
spark_alias: None,
};

/// A dimension's payload joins above the semi and anti joins that never read it
/// (`krishiv.optimizer.latePayloadJoin`).
pub static LATE_PAYLOAD_JOIN: ConfigEntry = ConfigEntry {
key: "krishiv.optimizer.latePayloadJoin",
value_type: ValueType::Bool,
default: Some(ConfigValue::Bool(true)),
doc: "Join a dimension's payload columns (such as a name read only by the aggregate on top) \
after the semi, anti and outer joins that never read them, and leave a semi join on the \
dimension's keys where the join was, so those joins build and probe narrower rows. Applies \
when statistics show the payload is wide and the dimension is the smaller side. Results \
are the same either way.",
scope: Scope::Session,
settable_by: SettableBy::User,
version_added: "0.1.0",
spark_alias: None,
};

/// Whether an aggregate's group keys from one dimension travel as one integer code (P2b D2).
pub static GROUP_KEY_CODE: ConfigEntry = ConfigEntry {
key: "krishiv.optimizer.groupKeyCode",
Expand Down
15 changes: 15 additions & 0 deletions crates/krishiv-common/src/config/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,21 @@ fn fuse_probe_select_defaults_on_and_parses() {
);
}

#[test]
fn late_payload_join_defaults_on_and_parses() {
let mut c = Config::new();
assert_eq!(
c.get(&LATE_PAYLOAD_JOIN).and_then(ConfigValue::as_bool),
Some(true)
);
c.set("krishiv.optimizer.latePayloadJoin", "false").unwrap();
assert_eq!(
c.get(&LATE_PAYLOAD_JOIN).and_then(ConfigValue::as_bool),
Some(false)
);
assert!(c.set("krishiv.optimizer.latePayloadJoin", "maybe").is_err());
}

#[test]
fn python_worker_entries_parse_and_default() {
let mut c = Config::new();
Expand Down
3 changes: 2 additions & 1 deletion crates/krishiv-exec/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ idle after `krishiv.exec.join.idleSpillAfter`, so the arbitrator asks them befor
30. Each probe driver then holds the build's level-0 tables, `build.rs` `Level0`, whose memory includes the per-partition
reservations moved at the seal; the last probe driver done after the flush barrier releases them, so a downstream
sink's final phase gets that memory; a `Prebuilt` broadcast build is never released) · `grace.rs` spill partitions,
flush-phase grace join · `broadcast.rs`
flush-phase grace join · `block.rs` a
partition's chunks kept few: the probe side's tiered merge, the build side's cut into the arena's 2^14-row blocks · `broadcast.rs`
(P2-T177 unit 3) `BroadcastTables`, a worker resource (`WorkerContext::with_broadcasts`): a broadcast join over a cut
broadcast exchange builds its table once per job and worker (its own query over the resource's pool, no spill, its
reservations never abort a query) and every task probes it through a `PrebuiltSink` that republishes its runtime
Expand Down
Loading
Loading