diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-12-31 00:08:39 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-12-31 00:08:39 +0000 |
commit | 8e8854daa2b4b3ef9e3fc1a56c79608a70018058 (patch) | |
tree | a6c4cf4b43acc764a38071843c10dc3edb3ca32e /src/backend/optimizer/plan/planner.c | |
parent | 0fb9be7acfb31ba38c1bbdd7883d5d03f6e261e5 (diff) | |
download | postgresql-8e8854daa2b4b3ef9e3fc1a56c79608a70018058.tar.gz postgresql-8e8854daa2b4b3ef9e3fc1a56c79608a70018058.zip |
Add some basic support for window frame clauses to the window-functions
patch. This includes the ability to force the frame to cover the whole
partition, and the ability to make the frame end exactly on the current row
rather than its last ORDER BY peer. Supporting any more of the full SQL
frame-clause syntax will require nontrivial hacking on the window aggregate
code, so it'll have to wait for 8.5 or beyond.
Diffstat (limited to 'src/backend/optimizer/plan/planner.c')
-rw-r--r-- | src/backend/optimizer/plan/planner.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index b4b578d5973..495503bb51e 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/plan/planner.c,v 1.248 2008/12/28 18:53:56 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/plan/planner.c,v 1.249 2008/12/31 00:08:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1398,12 +1398,14 @@ grouping_planner(PlannerInfo *root, double tuple_fraction) make_windowagg(root, (List *) copyObject(window_tlist), list_length(wflists->windowFuncs[wc->winref]), + wc->winref, partNumCols, partColIdx, partOperators, ordNumCols, ordColIdx, ordOperators, + wc->frameOptions, result_plan); } } @@ -2412,6 +2414,7 @@ select_active_windows(PlannerInfo *root, WindowFuncLists *wflists) WindowClause *wc2 = (WindowClause *) lfirst(lc); next = lnext(lc); + /* framing options are NOT to be compared here! */ if (equal(wc->partitionClause, wc2->partitionClause) && equal(wc->orderClause, wc2->orderClause)) { |