static Path *adjust_path_distribution(PlannerInfo *root, Query *parse,
Path *path);
static bool can_push_down_grouping(PlannerInfo *root, Query *parse, Path *path);
-
+static bool can_push_down_window(PlannerInfo *root, Path *path);
/*****************************************************************************
*
window_target = output_target;
}
+ /* We can't really push down window functions for now. */
+ if (!can_push_down_window(root, path))
+ path = create_remotesubplan_path(root, path, NULL);
+
path = (Path *)
create_windowagg_path(root, window_rel, path, window_target,
wflists->windowFuncs[wc->winref],
return grouping_distribution_match(root, parse, path, parse->groupClause);
}
+
+static bool
+can_push_down_window(PlannerInfo *root, Path *path)
+{
+ /* */
+ if (! path->distribution)
+ return true;
+
+ return false;
+}
pathnode->winclause = winclause;
pathnode->winpathkeys = winpathkeys;
+ pathnode->path.distribution = copyObject(subpath->distribution);
+
/*
* For costing purposes, assume that there are no redundant partitioning
* or ordering columns; it's not worth the trouble to deal with that
QUERY PLAN
-----------------------------------------------------------------
WindowAgg
- -> HashAggregate
+ -> Finalize GroupAggregate
Group Key: (tenk1.ten + tenk1.four)
-> Remote Subquery Scan on all (datanode_1,datanode_2)
- -> HashAggregate
- Group Key: (tenk1.ten + tenk1.four)
- -> Seq Scan on tenk1
-(7 rows)
+ -> Sort
+ Sort Key: ((tenk1.ten + tenk1.four))
+ -> Partial HashAggregate
+ Group Key: (tenk1.ten + tenk1.four)
+ -> Seq Scan on tenk1
+(9 rows)
-- test non-default frame specifications
SELECT four, ten,