File tree Expand file tree Collapse file tree
libs/@local/hashql/eval/src/postgres Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11//! Naming conventions and helpers for the continuation LATERAL subqueries.
22//!
33//! Each postgres island in a filter body produces a `CROSS JOIN LATERAL` subquery
4- //! that evaluates its CASE tree once per row (via `OFFSET 0`) and returns a
4+ //! that evaluates its CASE tree once per row and returns a
55//! composite `continuation` value. This module provides the identifiers, column
66//! names, and expression helpers used to construct and reference those subqueries.
77
@@ -80,7 +80,7 @@ impl From<ContinuationField> for ContinuationColumn {
8080pub ( crate ) enum ContinuationColumn {
8181 /// The composite `continuation` value column in the LATERAL subquery.
8282 ///
83- /// The LATERAL is `(SELECT <CASE tree>::continuation AS c OFFSET 0 ) AS f0`,
83+ /// The LATERAL is `(SELECT <CASE tree>::continuation AS c) AS f0`,
8484 /// so field access is `(f0."c")."filter"`.
8585 Entry ,
8686 /// The filter boolean. `NULL` means passthrough, `true` keeps, `false` rejects.
Original file line number Diff line number Diff line change 1717//! - **`block`** (`int`): next basic block when leaving the island.
1818//! - **`locals`** (`int[]`) and **`values`** (`jsonb[]`): parallel arrays carrying live-out locals.
1919//!
20- //! Continuation subqueries are forced to materialise once per row using `OFFSET 0` to prevent
21- //! PostgreSQL from inlining the subquery and duplicating the island's `CASE` tree per field access.
22- //!
2320//! ## Parameters and projections
2421//!
2522//! Parameters are deduplicated by identity and referenced by index (rendered as `$N` in SQL).
You can’t perform that action at this time.
0 commit comments