on master help sign in
Simplify the full-read advice to knot terms

Reword the in-memory-read diagnostic without SQL jargon (no "materialized", "pushdown", "SQL"). Now: "reads the whole X relation into memory", "X is read in full here", with help to filter/narrow (a where clause, base.take) or use an aggregate (base.count, base.sum) when only a number is needed. Suite 291/0.

commit36f216cc5e5387084d225386094f2bf8f2286f38 authoriko <mail@iko.soy> dateSun 30 Aug 2026, 07:55 (1 month ago) parentd9197b2
1 file changed+5−5
crates/knot-compiler/src/codegen.rs+5−5
crates/knot-compiler/src/codegen.rs+5−5
@@ -1104,16 +1104,16 @@ fn compile_inner<M: cranelift_module::Module>(
11041104 .collect::<Vec<_>>()
11051105 .join(", ");
11061106 let mut diag = knot::diagnostic::Diagnostic::info(format!(
1107− "full in-memory table read{}: {}",
1107+ "reads the whole {} relation{} into memory",
1108+ names,
11081109 if entries.len() == 1 { "" } else { "s" },
1109− names
11101110 ));
11111111 for (name, span) in &entries {
1112− diag = diag.label(**span, format!("`{name}` is loaded fully into memory here"));
1112+ diag = diag.label(**span, format!("`{name}` is read in full here"));
11131113 }
11141114 diag = diag
1115− .note("the query is materialized by `base.run` without SQL pushdown, so the whole table is loaded into memory")
1116− .note("to resolve: express the filter/projection in the query so the planner pushes it down to SQL; narrow with `where`/`take`; or use `base.count`/`base.sum` when you only need an aggregate");
1115+ .note("to read only part of it, filter or narrow the query (a `where` clause, `base.take`) so only the matching rows are loaded")
1116+ .note("if you only need a number, use an aggregate (base.count, base.sum) instead of reading the rows");
11171117 eprintln!("{}", diag.render(&cg.source_text, &cg.source_name));
11181118 }
11191119 Ok(cg)