3 ms·
> The default was NOT MATERIALIZED only because previous versions of SQLite didn't have this feature at all. The default was NOT MATERIALIZED because it's what
by masklinn 6y ago
> The default was NOT MATERIALIZED only because previous versions of SQLite didn't have this feature at all.
The default was NOT MATERIALIZED because it's what the sqlite devs had selected whe they implemented CTEs.
Pg did the exact opposite before the feature was added (and exposed to end-users): CTEs would always be MATERIALIZED. And similarly, with the introduction of [NOT] MATERIALIZED they changed the default in some cases: for pg if the CTE is non-recursive, has no side-effects, and is only referenced once, then it defaults to NOT MATERIALIZED.