3 ms·
LATERAL joins can help with reusing calculations https://www.periscopedata.com/blog/reuse-calculations-in-the-same-query-with-lateral-joins https://www.periscop
by danidiaz 8y ago
LATERAL joins can help with reusing calculations https://www.periscopedata.com/blog/reuse-calculations-in-the-same-query-with-lateral-joins https://www.periscopedata.com/blog/reuse-calculations-in-the...
- infinite8s 8y agoWow that's a bad example. Any decent query engine (which I'm assuming Postgres has) would reuse common subexpressions.
- danidiaz 8y agoEven if duplicate expressions are optimized by the engine, they hurt the readability and maintainability of the query, especially if they are big and complex.