Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
54e5d256
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
54e5d256
编写于
2月 08, 1999
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Optimizer cleanup.
上级
07c33ba7
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
88 addition
and
80 deletion
+88
-80
src/backend/nodes/copyfuncs.c
src/backend/nodes/copyfuncs.c
+8
-8
src/backend/nodes/equalfuncs.c
src/backend/nodes/equalfuncs.c
+11
-11
src/backend/nodes/freefuncs.c
src/backend/nodes/freefuncs.c
+5
-5
src/backend/nodes/readfuncs.c
src/backend/nodes/readfuncs.c
+11
-11
src/backend/optimizer/README
src/backend/optimizer/README
+8
-0
src/backend/optimizer/geqo/geqo_paths.c
src/backend/optimizer/geqo/geqo_paths.c
+2
-2
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/path/indxpath.c
+3
-3
src/backend/optimizer/path/joinpath.c
src/backend/optimizer/path/joinpath.c
+3
-3
src/backend/optimizer/path/joinutils.c
src/backend/optimizer/path/joinutils.c
+2
-2
src/backend/optimizer/path/mergeutils.c
src/backend/optimizer/path/mergeutils.c
+5
-5
src/backend/optimizer/path/orindxpath.c
src/backend/optimizer/path/orindxpath.c
+3
-3
src/backend/optimizer/path/prune.c
src/backend/optimizer/path/prune.c
+2
-2
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/createplan.c
+4
-4
src/backend/optimizer/util/pathnode.c
src/backend/optimizer/util/pathnode.c
+19
-19
src/include/nodes/relation.h
src/include/nodes/relation.h
+2
-2
未找到文件。
src/backend/nodes/copyfuncs.c
浏览文件 @
54e5d256
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.6
2 1999/02/05 19:59:25
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.6
3 1999/02/08 04:29:03
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1093,25 +1093,25 @@ CopyPathFields(Path *from, Path *newnode)
newnode
->
path_cost
=
from
->
path_cost
;
newnode
->
p
_ordering
.
ordtype
=
from
->
p_ordering
.
ordtype
;
if
(
from
->
p
_ordering
.
ordtype
==
SORTOP_ORDER
)
newnode
->
p
ath_order
.
ordtype
=
from
->
path_order
.
ordtype
;
if
(
from
->
p
ath_order
.
ordtype
==
SORTOP_ORDER
)
{
int
len
,
i
;
Oid
*
ordering
=
from
->
p
_ordering
.
ord
.
sortop
;
Oid
*
ordering
=
from
->
p
ath_order
.
ord
.
sortop
;
if
(
ordering
)
{
for
(
len
=
0
;
ordering
[
len
]
!=
0
;
len
++
)
;
newnode
->
p
_ordering
.
ord
.
sortop
=
(
Oid
*
)
palloc
(
sizeof
(
Oid
)
*
(
len
+
1
));
newnode
->
p
ath_order
.
ord
.
sortop
=
(
Oid
*
)
palloc
(
sizeof
(
Oid
)
*
(
len
+
1
));
for
(
i
=
0
;
i
<
len
;
i
++
)
newnode
->
p
_ordering
.
ord
.
sortop
[
i
]
=
ordering
[
i
];
newnode
->
p
_ordering
.
ord
.
sortop
[
len
]
=
0
;
newnode
->
p
ath_order
.
ord
.
sortop
[
i
]
=
ordering
[
i
];
newnode
->
p
ath_order
.
ord
.
sortop
[
len
]
=
0
;
}
}
else
Node_Copy
(
from
,
newnode
,
p
_ordering
.
ord
.
merge
);
Node_Copy
(
from
,
newnode
,
p
ath_order
.
ord
.
merge
);
Node_Copy
(
from
,
newnode
,
keys
);
...
...
src/backend/nodes/equalfuncs.c
浏览文件 @
54e5d256
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.2
5 1999/02/07 00:52:12 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.2
6 1999/02/08 04:29:04 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -337,33 +337,33 @@ _equalPath(Path *a, Path *b)
/*
* if (a->path_cost != b->path_cost) return(false);
*/
if
(
a
->
p
_ordering
.
ordtype
==
SORTOP_ORDER
)
if
(
a
->
p
ath_order
.
ordtype
==
SORTOP_ORDER
)
{
int
i
=
0
;
if
(
a
->
p
_ordering
.
ord
.
sortop
==
NULL
||
b
->
p
_ordering
.
ord
.
sortop
==
NULL
)
if
(
a
->
p
ath_order
.
ord
.
sortop
==
NULL
||
b
->
p
ath_order
.
ord
.
sortop
==
NULL
)
{
if
(
a
->
p
_ordering
.
ord
.
sortop
!=
b
->
p_ordering
.
ord
.
sortop
)
if
(
a
->
p
ath_order
.
ord
.
sortop
!=
b
->
path_order
.
ord
.
sortop
)
return
false
;
}
else
{
while
(
a
->
p
_ordering
.
ord
.
sortop
[
i
]
!=
0
&&
b
->
p
_ordering
.
ord
.
sortop
[
i
]
!=
0
)
while
(
a
->
p
ath_order
.
ord
.
sortop
[
i
]
!=
0
&&
b
->
p
ath_order
.
ord
.
sortop
[
i
]
!=
0
)
{
if
(
a
->
p
_ordering
.
ord
.
sortop
[
i
]
!=
b
->
p_ordering
.
ord
.
sortop
[
i
])
if
(
a
->
p
ath_order
.
ord
.
sortop
[
i
]
!=
b
->
path_order
.
ord
.
sortop
[
i
])
return
false
;
i
++
;
}
if
(
a
->
p
_ordering
.
ord
.
sortop
[
i
]
!=
0
||
b
->
p
_ordering
.
ord
.
sortop
[
i
]
!=
0
)
if
(
a
->
p
ath_order
.
ord
.
sortop
[
i
]
!=
0
||
b
->
p
ath_order
.
ord
.
sortop
[
i
]
!=
0
)
return
false
;
}
}
else
{
if
(
!
equal
(
a
->
p
_ordering
.
ord
.
merge
,
b
->
p_ordering
.
ord
.
merge
))
if
(
!
equal
(
a
->
p
ath_order
.
ord
.
merge
,
b
->
path_order
.
ord
.
merge
))
return
false
;
}
if
(
!
equal
(
a
->
keys
,
b
->
keys
))
...
...
src/backend/nodes/freefuncs.c
浏览文件 @
54e5d256
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.
1 1999/02/06 16:50:25 wieck
Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.
2 1999/02/08 04:29:04 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -756,13 +756,13 @@ _freeRelOptInfo(RelOptInfo * node)
static
void
FreePathFields
(
Path
*
node
)
{
if
(
node
->
p
_ordering
.
ordtype
==
SORTOP_ORDER
)
if
(
node
->
p
ath_order
.
ordtype
==
SORTOP_ORDER
)
{
if
(
node
->
p
_ordering
.
ord
.
sortop
)
pfree
(
node
->
p
_ordering
.
ord
.
sortop
);
if
(
node
->
p
ath_order
.
ord
.
sortop
)
pfree
(
node
->
p
ath_order
.
ord
.
sortop
);
}
else
freeObject
(
node
->
p
_ordering
.
ord
.
merge
);
freeObject
(
node
->
p
ath_order
.
ord
.
merge
);
freeObject
(
node
->
keys
);
...
...
src/backend/nodes/readfuncs.c
浏览文件 @
54e5d256
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.
49 1999/02/05 19:59:25
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.
50 1999/02/08 04:29:04
momjian Exp $
*
* NOTES
* Most of the read functions for plan nodes are tested. (In fact, they
...
...
@@ -1474,8 +1474,8 @@ _readPath()
local_node
->
path_cost
=
(
Cost
)
atof
(
token
);
#if 0
token = lsptok(NULL, &length); /* get :p
_ordering
*/
local_node->p
_ordering
= nodeRead(true); /* now read it */
token = lsptok(NULL, &length); /* get :p
ath_order
*/
local_node->p
ath_order
= nodeRead(true); /* now read it */
#endif
token
=
lsptok
(
NULL
,
&
length
);
/* get :keys */
...
...
@@ -1508,8 +1508,8 @@ _readIndexPath()
local_node
->
path
.
path_cost
=
(
Cost
)
atof
(
token
);
#if 0
token = lsptok(NULL, &length); /* get :p
_ordering
*/
local_node->path.p
_ordering
= nodeRead(true); /* now read it */
token = lsptok(NULL, &length); /* get :p
ath_order
*/
local_node->path.p
ath_order
= nodeRead(true); /* now read it */
#endif
token
=
lsptok
(
NULL
,
&
length
);
/* get :keys */
...
...
@@ -1549,8 +1549,8 @@ _readJoinPath()
local_node
->
path
.
path_cost
=
(
Cost
)
atof
(
token
);
#if 0
token = lsptok(NULL, &length); /* get :p
_ordering
*/
local_node->path.p
_ordering
= nodeRead(true); /* now read it */
token = lsptok(NULL, &length); /* get :p
ath_order
*/
local_node->path.p
ath_order
= nodeRead(true); /* now read it */
#endif
token
=
lsptok
(
NULL
,
&
length
);
/* get :keys */
...
...
@@ -1616,8 +1616,8 @@ _readMergePath()
local_node
->
jpath
.
path
.
path_cost
=
(
Cost
)
atof
(
token
);
#if 0
token = lsptok(NULL, &length); /* get :p
_ordering
*/
local_node->jpath.path.p
_ordering
= nodeRead(true); /* now read it */
token = lsptok(NULL, &length); /* get :p
ath_order
*/
local_node->jpath.path.p
ath_order
= nodeRead(true); /* now read it */
#endif
token
=
lsptok
(
NULL
,
&
length
);
/* get :keys */
...
...
@@ -1692,8 +1692,8 @@ _readHashPath()
local_node
->
jpath
.
path
.
path_cost
=
(
Cost
)
atof
(
token
);
#if 0
token = lsptok(NULL, &length); /* get :p
_ordering
*/
local_node->jpath.path.p
_ordering
= nodeRead(true); /* now read it */
token = lsptok(NULL, &length); /* get :p
ath_order
*/
local_node->jpath.path.p
ath_order
= nodeRead(true); /* now read it */
#endif
token
=
lsptok
(
NULL
,
&
length
);
/* get :keys */
...
...
src/backend/optimizer/README
浏览文件 @
54e5d256
The optimizer generates optimial query plans by doing several steps:
Take each relation in a query, and make a RelOptInfo structure for it.
Find each way of accessing the relation, called a Path, including
sequential and index scans, and add it to the RelOptInfo.path_order
list.
Optimizer Functions
-------------------
...
...
src/backend/optimizer/geqo/geqo_paths.c
浏览文件 @
54e5d256
...
...
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: geqo_paths.c,v 1.1
2 1998/09/01 04:29:21
momjian Exp $
* $Id: geqo_paths.c,v 1.1
3 1999/02/08 04:29:06
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -113,7 +113,7 @@ geqo_rel_paths(RelOptInfo * rel)
{
path
=
(
Path
*
)
lfirst
(
y
);
if
(
!
path
->
p
_ordering
.
ord
.
sortop
)
if
(
!
path
->
p
ath_order
.
ord
.
sortop
)
break
;
}
...
...
src/backend/optimizer/path/indxpath.c
浏览文件 @
54e5d256
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.3
8 1999/02/05 19:59:26
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.3
9 1999/02/08 04:29:08
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1290,8 +1290,8 @@ index_innerjoin(Query *root, RelOptInfo * rel, List *clausegroup_list,
pathnode
->
path
.
pathtype
=
T_IndexScan
;
pathnode
->
path
.
parent
=
rel
;
pathnode
->
path
.
p
_ordering
.
ordtype
=
SORTOP_ORDER
;
pathnode
->
path
.
p
_ordering
.
ord
.
sortop
=
index
->
ordering
;
pathnode
->
path
.
p
ath_order
.
ordtype
=
SORTOP_ORDER
;
pathnode
->
path
.
p
ath_order
.
ord
.
sortop
=
index
->
ordering
;
pathnode
->
path
.
keys
=
NIL
;
/* not sure about this, bjm 1998/09/21 */
pathnode
->
indexid
=
index
->
relids
;
...
...
src/backend/optimizer/path/joinpath.c
浏览文件 @
54e5d256
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.1
4 1999/02/04 03:19:08
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.1
5 1999/02/08 04:29:11
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -328,7 +328,7 @@ match_unsorted_outer(RelOptInfo * joinrel,
outerpath
=
(
Path
*
)
lfirst
(
i
);
outerpath_ordering
=
&
outerpath
->
p
_ordering
;
outerpath_ordering
=
&
outerpath
->
p
ath_order
;
if
(
outerpath_ordering
)
{
...
...
@@ -471,7 +471,7 @@ match_unsorted_inner(RelOptInfo * joinrel,
innerpath
=
(
Path
*
)
lfirst
(
i
);
innerpath_ordering
=
&
innerpath
->
p
_ordering
;
innerpath_ordering
=
&
innerpath
->
p
ath_order
;
if
(
innerpath_ordering
)
{
...
...
src/backend/optimizer/path/joinutils.c
浏览文件 @
54e5d256
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.1
0 1999/02/06 17:29:26
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.1
1 1999/02/08 04:29:12
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -219,7 +219,7 @@ match_paths_joinkeys(List *joinkeys,
key_match
=
every_func
(
joinkeys
,
path
->
keys
,
which_subkey
);
if
(
equal_path_ordering
(
ordering
,
&
path
->
p
_ordering
)
&&
&
path
->
p
ath_order
)
&&
length
(
joinkeys
)
==
length
(
path
->
keys
)
&&
key_match
)
{
...
...
src/backend/optimizer/path/mergeutils.c
浏览文件 @
54e5d256
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.1
3 1999/02/06 17:29:26
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.1
4 1999/02/08 04:29:12
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -52,16 +52,16 @@ group_clauses_by_order(List *restrictinfo_list,
* Create a new mergeinfo node and add it to 'mergeinfo-list'
* if one does not yet exist for this merge ordering.
*/
PathOrder
p
_ordering
;
PathOrder
p
ath_order
;
MergeInfo
*
xmergeinfo
;
Expr
*
clause
=
restrictinfo
->
clause
;
Var
*
leftop
=
get_leftop
(
clause
);
Var
*
rightop
=
get_rightop
(
clause
);
JoinKey
*
keys
;
p
_ordering
.
ordtype
=
MERGE_ORDER
;
p
_ordering
.
ord
.
merge
=
merge_ordering
;
xmergeinfo
=
match_order_mergeinfo
(
&
p
_ordering
,
mergeinfo_list
);
p
ath_order
.
ordtype
=
MERGE_ORDER
;
p
ath_order
.
ord
.
merge
=
merge_ordering
;
xmergeinfo
=
match_order_mergeinfo
(
&
p
ath_order
,
mergeinfo_list
);
if
(
inner_relid
==
leftop
->
varno
)
{
keys
=
makeNode
(
JoinKey
);
...
...
src/backend/optimizer/path/orindxpath.c
浏览文件 @
54e5d256
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.1
4 1999/02/03 21:16:28
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.1
5 1999/02/08 04:29:12
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -104,13 +104,13 @@ create_or_index_paths(Query *root,
pathnode
->
path
.
pathtype
=
T_IndexScan
;
pathnode
->
path
.
parent
=
rel
;
pathnode
->
path
.
p
_ordering
.
ordtype
=
SORTOP_ORDER
;
pathnode
->
path
.
p
ath_order
.
ordtype
=
SORTOP_ORDER
;
/*
* This is an IndexScan, but it does index lookups based
* on the order of the fields specified in the WHERE clause,
* not in any order, so the sortop is NULL.
*/
pathnode
->
path
.
p
_ordering
.
ord
.
sortop
=
NULL
;
pathnode
->
path
.
p
ath_order
.
ord
.
sortop
=
NULL
;
pathnode
->
path
.
keys
=
NIL
;
/* not sure about this, bjm 1998/09/21 */
pathnode
->
indexqual
=
lcons
(
clausenode
,
NIL
);
...
...
src/backend/optimizer/path/prune.c
浏览文件 @
54e5d256
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.2
3 1999/02/05 20:34:11
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.2
4 1999/02/08 04:29:12
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -109,7 +109,7 @@ prune_rel_paths(List *rel_list)
{
path
=
(
Path
*
)
lfirst
(
y
);
if
(
!
path
->
p
_ordering
.
ord
.
sortop
)
if
(
!
path
->
p
ath_order
.
ord
.
sortop
)
break
;
}
cheapest
=
(
JoinPath
*
)
prune_rel_path
(
rel
,
path
);
...
...
src/backend/optimizer/plan/createplan.c
浏览文件 @
54e5d256
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.3
7 1999/02/05 19:59:2
7 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.3
8 1999/02/08 04:29:1
7 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -529,14 +529,14 @@ create_mergejoin_node(MergePath *best_path,
outer_tlist
,
inner_tlist
));
opcode
=
get_opcode
((
best_path
->
jpath
.
path
.
p
_ordering
.
ord
.
merge
)
->
join_operator
);
opcode
=
get_opcode
((
best_path
->
jpath
.
path
.
p
ath_order
.
ord
.
merge
)
->
join_operator
);
outer_order
=
(
Oid
*
)
palloc
(
sizeof
(
Oid
)
*
2
);
outer_order
[
0
]
=
(
best_path
->
jpath
.
path
.
p
_ordering
.
ord
.
merge
)
->
left_operator
;
outer_order
[
0
]
=
(
best_path
->
jpath
.
path
.
p
ath_order
.
ord
.
merge
)
->
left_operator
;
outer_order
[
1
]
=
0
;
inner_order
=
(
Oid
*
)
palloc
(
sizeof
(
Oid
)
*
2
);
inner_order
[
0
]
=
(
best_path
->
jpath
.
path
.
p
_ordering
.
ord
.
merge
)
->
right_operator
;
inner_order
[
0
]
=
(
best_path
->
jpath
.
path
.
p
ath_order
.
ord
.
merge
)
->
right_operator
;
inner_order
[
1
]
=
0
;
/*
...
...
src/backend/optimizer/util/pathnode.c
浏览文件 @
54e5d256
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.
19 1999/02/06 17:29:27
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.
20 1999/02/08 04:29:21
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -165,8 +165,8 @@ better_path(Path *new_path, List *unique_paths, bool *noOther)
path
=
(
Path
*
)
lfirst
(
temp
);
if
(
samekeys
(
path
->
keys
,
new_path
->
keys
)
&&
equal_path_ordering
(
&
path
->
p
_ordering
,
&
new_path
->
p
_ordering
))
equal_path_ordering
(
&
path
->
p
ath_order
,
&
new_path
->
p
ath_order
))
{
old_path
=
path
;
break
;
...
...
@@ -207,8 +207,8 @@ create_seqscan_path(RelOptInfo * rel)
pathnode
->
pathtype
=
T_SeqScan
;
pathnode
->
parent
=
rel
;
pathnode
->
path_cost
=
0
.
0
;
pathnode
->
p
_ordering
.
ordtype
=
SORTOP_ORDER
;
pathnode
->
p
_ordering
.
ord
.
sortop
=
NULL
;
pathnode
->
p
ath_order
.
ordtype
=
SORTOP_ORDER
;
pathnode
->
p
ath_order
.
ord
.
sortop
=
NULL
;
pathnode
->
keys
=
NIL
;
/*
...
...
@@ -256,8 +256,8 @@ create_index_path(Query *root,
pathnode
->
path
.
pathtype
=
T_IndexScan
;
pathnode
->
path
.
parent
=
rel
;
pathnode
->
path
.
p
_ordering
.
ordtype
=
SORTOP_ORDER
;
pathnode
->
path
.
p
_ordering
.
ord
.
sortop
=
index
->
ordering
;
pathnode
->
path
.
p
ath_order
.
ordtype
=
SORTOP_ORDER
;
pathnode
->
path
.
p
ath_order
.
ord
.
sortop
=
index
->
ordering
;
pathnode
->
indexid
=
index
->
relids
;
pathnode
->
indexkeys
=
index
->
indexkeys
;
...
...
@@ -274,7 +274,7 @@ create_index_path(Query *root,
* The index must have an ordering for the path to have (ordering)
* keys, and vice versa.
*/
if
(
pathnode
->
path
.
p
_ordering
.
ord
.
sortop
)
if
(
pathnode
->
path
.
p
ath_order
.
ord
.
sortop
)
{
pathnode
->
path
.
keys
=
collect_index_pathkeys
(
index
->
indexkeys
,
rel
->
targetlist
);
...
...
@@ -286,7 +286,7 @@ create_index_path(Query *root,
* if no index keys were found, we can't order the path).
*/
if
(
pathnode
->
path
.
keys
==
NULL
)
pathnode
->
path
.
p
_ordering
.
ord
.
sortop
=
NULL
;
pathnode
->
path
.
p
ath_order
.
ord
.
sortop
=
NULL
;
}
else
pathnode
->
path
.
keys
=
NULL
;
...
...
@@ -415,20 +415,20 @@ create_nestloop_path(RelOptInfo * joinrel,
if
(
keys
)
{
pathnode
->
path
.
p
_ordering
.
ordtype
=
outer_path
->
p_ordering
.
ordtype
;
if
(
outer_path
->
p
_ordering
.
ordtype
==
SORTOP_ORDER
)
pathnode
->
path
.
p
ath_order
.
ordtype
=
outer_path
->
path_order
.
ordtype
;
if
(
outer_path
->
p
ath_order
.
ordtype
==
SORTOP_ORDER
)
{
pathnode
->
path
.
p
_ordering
.
ord
.
sortop
=
outer_path
->
p_ordering
.
ord
.
sortop
;
pathnode
->
path
.
p
ath_order
.
ord
.
sortop
=
outer_path
->
path_order
.
ord
.
sortop
;
}
else
{
pathnode
->
path
.
p
_ordering
.
ord
.
merge
=
outer_path
->
p_ordering
.
ord
.
merge
;
pathnode
->
path
.
p
ath_order
.
ord
.
merge
=
outer_path
->
path_order
.
ord
.
merge
;
}
}
else
{
pathnode
->
path
.
p
_ordering
.
ordtype
=
SORTOP_ORDER
;
pathnode
->
path
.
p
_ordering
.
ord
.
sortop
=
NULL
;
pathnode
->
path
.
p
ath_order
.
ordtype
=
SORTOP_ORDER
;
pathnode
->
path
.
p
ath_order
.
ord
.
sortop
=
NULL
;
}
pathnode
->
path
.
path_cost
=
cost_nestloop
(
outer_path
->
path_cost
,
...
...
@@ -487,8 +487,8 @@ create_mergejoin_path(RelOptInfo * joinrel,
pathnode
->
jpath
.
innerjoinpath
=
inner_path
;
pathnode
->
jpath
.
pathinfo
=
joinrel
->
restrictinfo
;
pathnode
->
jpath
.
path
.
keys
=
keys
;
pathnode
->
jpath
.
path
.
p
_ordering
.
ordtype
=
MERGE_ORDER
;
pathnode
->
jpath
.
path
.
p
_ordering
.
ord
.
merge
=
order
;
pathnode
->
jpath
.
path
.
p
ath_order
.
ordtype
=
MERGE_ORDER
;
pathnode
->
jpath
.
path
.
p
ath_order
.
ord
.
merge
=
order
;
pathnode
->
path_mergeclauses
=
mergeclauses
;
pathnode
->
jpath
.
path
.
loc_restrictinfo
=
NIL
;
pathnode
->
outersortkeys
=
outersortkeys
;
...
...
@@ -552,8 +552,8 @@ create_hashjoin_path(RelOptInfo * joinrel,
pathnode
->
jpath
.
pathinfo
=
joinrel
->
restrictinfo
;
pathnode
->
jpath
.
path
.
loc_restrictinfo
=
NIL
;
pathnode
->
jpath
.
path
.
keys
=
keys
;
pathnode
->
jpath
.
path
.
p
_ordering
.
ordtype
=
SORTOP_ORDER
;
pathnode
->
jpath
.
path
.
p
_ordering
.
ord
.
sortop
=
NULL
;
pathnode
->
jpath
.
path
.
p
ath_order
.
ordtype
=
SORTOP_ORDER
;
pathnode
->
jpath
.
path
.
p
ath_order
.
ord
.
sortop
=
NULL
;
pathnode
->
jpath
.
path
.
outerjoincost
=
(
Cost
)
0
.
0
;
pathnode
->
jpath
.
path
.
joinid
=
(
Relid
)
NULL
;
/* pathnode->hashjoinoperator = operator; */
...
...
src/include/nodes/relation.h
浏览文件 @
54e5d256
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: relation.h,v 1.1
5 1999/02/05 19:59:31
momjian Exp $
* $Id: relation.h,v 1.1
6 1999/02/08 04:29:25
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -144,7 +144,7 @@ typedef struct Path
NodeTag
pathtype
;
PathOrder
p
_ordering
;
PathOrder
p
ath_order
;
List
*
keys
;
Cost
outerjoincost
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录