Perfomance issue with N1QL self join

Thanks @daschl , this is a great help. Now I am going to do that first. Cheers