3 ms·
Now that CTEs are no longer optimization fences in recent versions of Postgres, is there a way to somehow manually declare an optimization fence around a certai
by nerdponx 3y ago
Now that CTEs are no longer optimization fences in recent versions of Postgres, is there a way to somehow manually declare an optimization fence around a certain region of the query?
I've had similar problems in Snowflake with the query planner taking a bad path, and no obvious way to hint otherwise.
- bhaak 3y agoFunctions are hard barriers for optimization and I don't see that changing any time soon. Which goes even so far that EXPLAIN doesn't work on them and you just get a black box of "Function call to ..." in the execution plan. Using auto_explain is the only workaround known to me for that.
- baq 3y agoWITH MATERIALIZED restores the fence.