My manager asked me not to use recursive query since recursive by default means slow he claimed.
I’m just wondering if recursive query slow and if there is any other alternative way.
EDIT:
I’m talking about recursive query in general. My manager just told me to stop using recursive. His claim was in C# recursive function is slow. So don’t use recursive query on Oracle which could be slow as well.
In matters of performance, only benchmarks matter. Guesses and analogies are worthless.
There is no absolute reason why recursive queries should perform badly, just because they are recursive. What usually happens is that recursive queries get more expensive against larger data sets than a non-recursive query against a table of a similar size.
This is not an argument for never using recursive queries: it is an argument for testing our CONNECT BY queries against representative data volumes and seeing whether we might have a performance problem. The mechanisms for avoiding recursive queries (for instance maintaining tables to store a flattened hierarchy ) have their own cost profiles.
If you want to learn some more about alternative to recursive queries, I answered a related question a while back. Check it out. .