3 ms·
Very cool and useful stuff, but aren't CTEs optimization fences in postgres? If you're dealing with largeish tables and several linked CTEs this might get too
by isoprophlex 6y ago
Very cool and useful stuff, but aren't CTEs optimization fences in postgres?
If you're dealing with largeish tables and several linked CTEs this might get too slow, and you're still stuck on optimizing your queries manually.
AFAIK subqueries do allow predicate pushdown, etc. Maybe for postgres, composability can be achieved through subqueries.
Nevertheless very cool stuff!
- zimpenfish 6y ago> aren't CTEs optimization fences in postgres? Apparently "not all the time with PG12". https://www.depesz.com/2019/02/19/waiting-for-postgresql-12-allow-user-control-of-cte-materialization-and-change-the-default-behavior/ https://www.depesz.com/2019/02/19/waiting-for-postgresql-12-...
- isoprophlex 6y agoInteresting! I didn't know that, thanks!
- akdor1154 6y agoHmm, interesting and good to know, thanks. (and damn, subqueries are awful to read :( ) If there was appetite, it would be straightforward to make `csql` work by generating subqueries instead, might be something to add to the TODO list!