# v0.63.0 — Fused Multi-Node Refresh

> **Full details:** [v0.63.0.md-full.md](v0.63.0.md-full.md)

## What's New

v0.63.0 implements fused multi-node refresh: when the scheduler has a
batch of stream tables ready to refresh in the same tick, it emits a
single CTE chain rather than N sequential statements.  This is the
Postgres-native analogue of DBSP's single-pass evaluation — one
transaction, one planner invocation, one round-trip to the server.

### PERF-2: Fused CTE Refresh (P-2)

When two or more nodes in the same DAG are scheduled to refresh in the
same tick, the scheduler composes their delta SQL into a single
`WITH … INSERT` CTE chain:

```sql
WITH
  b_delta AS (/* delta SQL for order_totals */),
  c_delta AS (/* delta SQL for customer_summary, reading b_delta */),
  …
INSERT INTO order_totals …  SELECT * FROM b_delta;
INSERT INTO customer_summary … SELECT * FROM c_delta;
```

The DVM engine already generates correct per-node delta SQL; this
release composes those fragments in topological order within a single
statement.  Cross-node optimisation by the Postgres query planner is
now possible for nodes that share sub-expressions.

**Benchmark gate (blocking):** The TPC-H 22-node DAG at Δ = 10 K rows
must show ≥ 20 % reduction in total refresh wall time vs. v0.62.0
(which already has fan-out).  Measured by the existing
`refresh_bench::tpch_differential_22` criterion benchmark.

**Opt-out GUC:** `pg_trickle.enable_fused_refresh` (bool, default
`true`).  Set to `false` to restore the pre-v0.63.0 sequential
per-node statement behaviour — useful when a complex DAG shape
produces a query the Postgres planner cannot handle efficiently.

**Correctness gate (blocking):** The existing plan→apply→plan
property test is extended to assert that fused and sequential refresh
produce byte-identical materialized state for all 22 TPC-H stream
tables across 50 random Δ batches.
