Fork me on GitHub
#xtdb
<
2023-04-01
>
djtango18:04:59

I'm dealing with a recursive query that is stackoverflowing - is there a way to set a recursion depth limit?

refset15:04:48

Hey @U0HJD63RN I don't think we've been asked about this before(!) I don't believe we have any mechanism for controlling this currently :thinking_face: Is this recursion due to a single rule? Or mutually recursive rules?

refset15:04:07

I have just created an issue to discuss the requirement in more depth, feel free to chime in there as well / instead https://github.com/xtdb/xtdb/issues/1930

djtango07:04:17

Thanks @U899JBRPF this recursion was a single rule "find me the children of this node" it turns out that I had bad data that had parent pointing to child in this case

👍 2
Martynas Maciulevičius06:04:49

I'm not experienced in recursive queries but could you for instance accumulate IDs when you walk through the graph? Then you would use this visited set to find loops in your data. You could have this loop finding query separately then. i.e. DFS but you'd accumulate into a set and then either crash or return it as a result.