4 ms·
If you don't use recursive CTEs in SQL you have a guaranteed-terminating subset. It actually doesn't help any because time to terminate can be effectively unlim
by throwaway_pdp09 6y ago
If you don't use recursive CTEs in SQL you have a guaranteed-terminating subset. It actually doesn't help any because time to terminate can be effectively unlimited depending on (in any combintaion)
- not having indexes
- a bad execution plan
- an overcomplex query (tend to kill the optimiser)
- bad distribution stats (again -> a bad plan)
- a large dataset
- and maybe others.
Practially speaking... well IDK, how do you reconcile that with your work? It's a real puzzler for me (language theory is an interest of mine, but sql brings home the bacon when I have work) so your input will be very welcome.
- maweki 6y agoIf you have termination in general, it's much easier to get time bounds from input size. If you can't prove termination, you can't prove time bounds. And then how do you improve on that, besides guesstimating and benchmarking?