Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
f0e7e2fa
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,发现更多精彩内容 >>
提交
f0e7e2fa
编写于
2月 23, 1998
作者:
V
Vadim B. Mikheev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ExecReScan for Unique & Sort nodes.
上级
e4fd5346
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
83 addition
and
11 deletion
+83
-11
src/backend/executor/execAmi.c
src/backend/executor/execAmi.c
+10
-1
src/backend/executor/nodeSort.c
src/backend/executor/nodeSort.c
+26
-3
src/backend/executor/nodeUnique.c
src/backend/executor/nodeUnique.c
+17
-1
src/backend/utils/sort/psort.c
src/backend/utils/sort/psort.c
+24
-3
src/include/executor/nodeSort.h
src/include/executor/nodeSort.h
+2
-1
src/include/executor/nodeUnique.h
src/include/executor/nodeUnique.h
+2
-1
src/include/utils/psort.h
src/include/utils/psort.h
+2
-1
未找到文件。
src/backend/executor/execAmi.c
浏览文件 @
f0e7e2fa
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.1
7 1998/02/13 03:26:36
vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.1
8 1998/02/23 06:26:53
vadim Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -43,6 +43,7 @@
#include "executor/nodeHash.h"
#include "executor/nodeAgg.h"
#include "executor/nodeResult.h"
#include "executor/nodeUnique.h"
#include "executor/nodeSubplan.h"
#include "executor/execdebug.h"
#include "optimizer/internal.h"
/* for _TEMP_RELATION_ID_ */
...
...
@@ -354,6 +355,14 @@ ExecReScan(Plan *node, ExprContext *exprCtxt, Plan *parent)
ExecReScanResult
((
Result
*
)
node
,
exprCtxt
,
parent
);
break
;
case
T_Unique
:
ExecReScanUnique
((
Unique
*
)
node
,
exprCtxt
,
parent
);
break
;
case
T_Sort
:
ExecReScanSort
((
Sort
*
)
node
,
exprCtxt
,
parent
);
break
;
/*
* Tee is never used
case T_Tee:
...
...
src/backend/executor/nodeSort.c
浏览文件 @
f0e7e2fa
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.1
2 1998/01/07 21:02:56 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.1
3 1998/02/23 06:26:56 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -183,8 +183,6 @@ ExecSort(Sort *node)
else
{
slot
=
(
TupleTableSlot
*
)
sortstate
->
csstate
.
cstate
.
cs_ResultTupleSlot
;
/* *** get_cs_ResultTupleSlot((CommonState) sortstate); */
/* slot = sortstate->csstate.css_ScanTupleSlot; orig */
}
SO1_printf
(
"ExecSort: %s
\n
"
,
...
...
@@ -390,3 +388,28 @@ ExecSortRestrPos(Sort *node)
*/
psort_restorepos
(
node
);
}
void
ExecReScanSort
(
Sort
*
node
,
ExprContext
*
exprCtxt
,
Plan
*
parent
)
{
SortState
*
sortstate
=
node
->
sortstate
;
/*
* If we haven't sorted yet, just return. If outerplan'
* chgParam is not NULL then it will be re-scanned by
* ExecProcNode, else - no reason to re-scan it at all.
*/
if
(
sortstate
->
sort_Flag
==
false
)
return
;
ExecClearTuple
(
sortstate
->
csstate
.
cstate
.
cs_ResultTupleSlot
);
psort_rescan
(
node
);
/*
* If subnode is to be rescanned then we aren't sorted
*/
if
(((
Plan
*
)
node
)
->
lefttree
->
chgParam
!=
NULL
)
sortstate
->
sort_Flag
=
false
;
}
src/backend/executor/nodeUnique.c
浏览文件 @
f0e7e2fa
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.1
5 1998/02/18 12:40:44
vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.1
6 1998/02/23 06:26:58
vadim Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -355,3 +355,19 @@ ExecEndUnique(Unique *node)
ExecEndNode
(
outerPlan
((
Plan
*
)
node
),
(
Plan
*
)
node
);
ExecClearTuple
(
uniquestate
->
cs_ResultTupleSlot
);
}
void
ExecReScanUnique
(
Unique
*
node
,
ExprContext
*
exprCtxt
,
Plan
*
parent
)
{
UniqueState
*
uniquestate
=
node
->
uniquestate
;
ExecClearTuple
(
uniquestate
->
cs_ResultTupleSlot
);
/*
* if chgParam of subnode is not null then plan
* will be re-scanned by first ExecProcNode.
*/
if
(((
Plan
*
)
node
)
->
lefttree
->
chgParam
==
NULL
)
ExecReScan
(((
Plan
*
)
node
)
->
lefttree
,
exprCtxt
,
(
Plan
*
)
node
);
}
src/backend/utils/sort/psort.c
浏览文件 @
f0e7e2fa
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.3
7 1998/02/11 19:13:47 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.3
8 1998/02/23 06:27:39 vadim
Exp $
*
* NOTES
* Sorts the first relation into the second relation.
...
...
@@ -924,8 +924,6 @@ psort_end(Sort * node)
if
(
!
node
->
cleaned
)
{
Assert
(
node
!=
(
Sort
*
)
NULL
);
/*
* I'm changing this because if we are sorting a relation with no
* tuples, psortstate is NULL.
...
...
@@ -944,12 +942,35 @@ psort_end(Sort * node)
(
int
)
ceil
((
double
)
PS
(
node
)
->
BytesWritten
/
BLCKSZ
);
pfree
((
void
*
)
node
->
psortstate
);
node
->
psortstate
=
NULL
;
node
->
cleaned
=
TRUE
;
}
}
}
void
psort_rescan
(
Sort
*
node
)
{
/*
* If subnode is to be rescanned then free our previous results
*/
if
(((
Plan
*
)
node
)
->
lefttree
->
chgParam
!=
NULL
)
{
psort_end
(
node
);
node
->
cleaned
=
false
;
}
else
if
(
PS
(
node
)
!=
(
Psortstate
*
)
NULL
)
{
PS
(
node
)
->
all_fetched
=
false
;
PS
(
node
)
->
psort_current
=
0
;
PS
(
node
)
->
psort_saved
=
0
;
if
(
PS
(
node
)
->
using_tape_files
==
true
)
rewind
(
PS
(
node
)
->
psort_grab_file
);
}
}
/*
* gettape - handles access temporary files in polyphase merging
*
...
...
src/include/executor/nodeSort.h
浏览文件 @
f0e7e2fa
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: nodeSort.h,v 1.
5 1997/11/26 01:13:04 momjian
Exp $
* $Id: nodeSort.h,v 1.
6 1998/02/23 06:27:55 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -23,5 +23,6 @@ extern int ExecCountSlotsSort(Sort *node);
extern
void
ExecEndSort
(
Sort
*
node
);
extern
void
ExecSortMarkPos
(
Sort
*
node
);
extern
void
ExecSortRestrPos
(
Sort
*
node
);
extern
void
ExecReScanSort
(
Sort
*
node
,
ExprContext
*
exprCtxt
,
Plan
*
parent
);
#endif
/* NODESORT_H */
src/include/executor/nodeUnique.h
浏览文件 @
f0e7e2fa
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: nodeUnique.h,v 1.
5 1997/11/26 01:13:06 momjian
Exp $
* $Id: nodeUnique.h,v 1.
6 1998/02/23 06:27:56 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -21,5 +21,6 @@ extern TupleTableSlot *ExecUnique(Unique *node);
extern
bool
ExecInitUnique
(
Unique
*
node
,
EState
*
estate
,
Plan
*
parent
);
extern
int
ExecCountSlotsUnique
(
Unique
*
node
);
extern
void
ExecEndUnique
(
Unique
*
node
);
extern
void
ExecReScanUnique
(
Unique
*
node
,
ExprContext
*
exprCtxt
,
Plan
*
parent
);
#endif
/* NODEUNIQUE_H */
src/include/utils/psort.h
浏览文件 @
f0e7e2fa
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: psort.h,v 1.1
4 1997/10/15 06:36:3
6 vadim Exp $
* $Id: psort.h,v 1.1
5 1998/02/23 06:28:1
6 vadim Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -104,5 +104,6 @@ extern HeapTuple psort_grabtuple(Sort *node, bool *should_free);
extern
void
psort_markpos
(
Sort
*
node
);
extern
void
psort_restorepos
(
Sort
*
node
);
extern
void
psort_end
(
Sort
*
node
);
extern
void
psort_rescan
(
Sort
*
node
);
#endif
/* PSORT_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录