neo4j/neo4j — pull request #2952 by jakub- (2014-08-28 14:27:34+00:00)
Title: Add the projectFreshSortExpressions rewriter

Also, dismantle another part of inlineProjections by never introducing
ReturnAll into the AST. The reason being is that ReturnAll makes it harder
for PlannerQueryBuilder to reason about the required arguments that need to be
projected onto a tail planner query.

In addition, change the projection step to be more aggresive about optimising out
Projection plans by allowing supersets of projection maps in intermediate horizons
such as WITH. This preserves the behaviour of ReturnAll that would always lead to
StarProjections.