3 ms·
Wow that's a bad example. Any decent query engine (which I'm assuming Postgres has) would reuse common subexpressions.
by infinite8s 8y ago
Wow 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.