Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8286223

Browse files
committed
Fix missing outfuncs.c support for IncrementalSortPath.
For debugging purposes, Path nodes are supposed to have outfuncssupport, but this was overlooked in the original incremental sort patch.While at it, clean up a couple other minor oversights, as well asbizarre choice of return type for create_incremental_sort_path().(All the existing callers just cast it to "Path *" immediately, sothey don't care, but some future caller might care.)outfuncs.c fix by Zhijie Hou, the rest by meDiscussion:https://postgr.es/m/324c4d81d8134117972a5b1f6cdf9560@G08CNEXMBPEKD05.g08.fujitsu.local
1 parent58ebe96 commit8286223

File tree

5 files changed

+34
-11
lines changed

5 files changed

+34
-11
lines changed

‎src/backend/nodes/outfuncs.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,14 +1954,30 @@ _outProjectSetPath(StringInfo str, const ProjectSetPath *node)
19541954
WRITE_NODE_FIELD(subpath);
19551955
}
19561956

1957+
staticvoid
1958+
_outSortPathInfo(StringInfostr,constSortPath*node)
1959+
{
1960+
_outPathInfo(str, (constPath*)node);
1961+
1962+
WRITE_NODE_FIELD(subpath);
1963+
}
1964+
19571965
staticvoid
19581966
_outSortPath(StringInfostr,constSortPath*node)
19591967
{
19601968
WRITE_NODE_TYPE("SORTPATH");
19611969

1962-
_outPathInfo(str, (constPath*)node);
1970+
_outSortPathInfo(str,node);
1971+
}
19631972

1964-
WRITE_NODE_FIELD(subpath);
1973+
staticvoid
1974+
_outIncrementalSortPath(StringInfostr,constIncrementalSortPath*node)
1975+
{
1976+
WRITE_NODE_TYPE("INCREMENTALSORTPATH");
1977+
1978+
_outSortPathInfo(str, (constSortPath*)node);
1979+
1980+
WRITE_INT_FIELD(nPresortedCols);
19651981
}
19661982

19671983
staticvoid
@@ -4055,6 +4071,9 @@ outNode(StringInfo str, const void *obj)
40554071
caseT_SortPath:
40564072
_outSortPath(str,obj);
40574073
break;
4074+
caseT_IncrementalSortPath:
4075+
_outIncrementalSortPath(str,obj);
4076+
break;
40584077
caseT_GroupPath:
40594078
_outGroupPath(str,obj);
40604079
break;

‎src/backend/optimizer/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ RelOptInfo - a relation or joined relations
387387
ProjectionPath - a Result plan node with child (used for projection)
388388
ProjectSetPath - a ProjectSet plan node applied to some sub-path
389389
SortPath - a Sort plan node applied to some sub-path
390+
IncrementalSortPath - an IncrementalSort plan node applied to some sub-path
390391
GroupPath - a Group plan node applied to some sub-path
391392
UpperUniquePath - a Unique plan node applied to some sub-path
392393
AggPath - an Agg plan node applied to some sub-path

‎src/backend/optimizer/util/pathnode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2798,7 +2798,7 @@ create_set_projection_path(PlannerInfo *root,
27982798
* 'limit_tuples' is the estimated bound on the number of output tuples,
27992799
*or -1 if no LIMIT or couldn't estimate
28002800
*/
2801-
SortPath*
2801+
IncrementalSortPath*
28022802
create_incremental_sort_path(PlannerInfo*root,
28032803
RelOptInfo*rel,
28042804
Path*subpath,
@@ -2834,7 +2834,7 @@ create_incremental_sort_path(PlannerInfo *root,
28342834

28352835
sort->nPresortedCols=presorted_keys;
28362836

2837-
returnpathnode;
2837+
returnsort;
28382838
}
28392839

28402840
/*

‎src/include/nodes/pathnodes.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,10 @@ typedef struct SortPath
16551655
}SortPath;
16561656

16571657
/*
1658-
* IncrementalSortPath
1658+
* IncrementalSortPath represents an incremental sort step
1659+
*
1660+
* This is like a regular sort, except some leading key columns are assumed
1661+
* to be ordered already.
16591662
*/
16601663
typedefstructIncrementalSortPath
16611664
{

‎src/include/optimizer/pathnode.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,17 @@ extern ProjectSetPath *create_set_projection_path(PlannerInfo *root,
184184
RelOptInfo*rel,
185185
Path*subpath,
186186
PathTarget*target);
187-
externSortPath*create_incremental_sort_path(PlannerInfo*root,
188-
RelOptInfo*rel,
189-
Path*subpath,
190-
List*pathkeys,
191-
intpresorted_keys,
192-
doublelimit_tuples);
193187
externSortPath*create_sort_path(PlannerInfo*root,
194188
RelOptInfo*rel,
195189
Path*subpath,
196190
List*pathkeys,
197191
doublelimit_tuples);
192+
externIncrementalSortPath*create_incremental_sort_path(PlannerInfo*root,
193+
RelOptInfo*rel,
194+
Path*subpath,
195+
List*pathkeys,
196+
intpresorted_keys,
197+
doublelimit_tuples);
198198
externGroupPath*create_group_path(PlannerInfo*root,
199199
RelOptInfo*rel,
200200
Path*subpath,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp