Tweaked planning algorithm to generate only merge blocks with the same
join variables
Added implementation of Heuristics 3