Please help me to tune the below query . Its failing with Spool space issue .
Try to check if there are duplicates on the join columns. If exists, remove those. Ignoring will leave to bad perf.
Try to collect statistics on the join columns.