1. The standards define CTE's as being stable within a statement. I.e. they don't change as the query progresses.
2. The way this is implemented in PostgreSQL currently is to have CTE's as optimization fences.
Presumably some cross-CTE optimization may be added in the future but in usual cases, will be slowly added with a lot of care.
1. The standards define CTE's as being stable within a statement. I.e. they don't change as the query progresses.
2. The way this is implemented in PostgreSQL currently is to have CTE's as optimization fences.
Presumably some cross-CTE optimization may be added in the future but in usual cases, will be slowly added with a lot of care.