18 min read
Gaps and Islands in ClickHouse: Moving a Window Function Into Materialized Views
ClickHouse incremental materialized views only ever see one insert block, so a gaps-and-islands window function looks impossible. Here is how to seed the window with stored state and run it inside the MV - with verified SQL, three silent traps, and the sharding constraint that actually limits it.