3 ms·
And yet after 30+ years no one had adequately managed to replace it. God help us if it's one of those json based abominations. My main complaint with sql is tha
by Guthur 8y ago
And yet after 30+ years no one had adequately managed to replace it. God help us if it's one of those json based abominations. My main complaint with sql is that it can be somewhat difficult top make DRY.
- gaius 8y agoCTEs can go a long way toward that, as can stored procs
- dragonwriter 8y agoAs can views.
- danidiaz 8y agoLATERAL 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.