Not able to query across tree structure with millions of links

@Raphael could you support here please?