That's why a separate fully-analyzable language is needed. FLWOR is a nice example because it's functional and fully reference-transparent. So optimization engine can backtrack through definitions and get the complete picture of what's happening. And then use tried-and-true join optimizations.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds