3 ms·
Recursive CTEs are super cool! I don't use them very often for the problems I'm trying to solve, but I regularly use non-recursive CTEs to organize queries inst
by zrail 12y ago
Recursive CTEs are super cool! I don't use them very often for the problems I'm trying to solve, but I regularly use non-recursive CTEs to organize queries instead of using deeply nested subqueries.
- peri 12y agoI hope you warn your dbas before you do this :)
- zrail 12y agoAre you referring to the fact that CTEs are an optimization boundary in PostgreSQL and (presumably) most other systems? In any case, most of the time I'm the DBA so it doesn't really matter ;)
- peri 12y agoSorry to poke this thread so far later, but I was actually thinking more of other users of your VMs if you're doing this in the cloud :)
- ThePhysicist 12y agoYeah I agree, most queries can be done without using CTEs, but some problems can hardly be solved without them. I'm thinking e.g. of finding paths in a graph or querying highly hierarchical data in an efficient way.