moved some planner logic to plannodebuilder

for QueryAndFetchNode (not in grouping queries) and QueryThenFetchNode
with this check this won't work if sourceRelation is an alias