Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
032c9d7b
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
032c9d7b
编写于
12月 13, 2021
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-12034 Define physical plan data structure.
上级
6031721f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
45 addition
and
26 deletion
+45
-26
include/libs/planner/planner.h
include/libs/planner/planner.h
+6
-6
source/libs/planner/inc/plannerInt.h
source/libs/planner/inc/plannerInt.h
+34
-16
source/libs/planner/src/planner.c
source/libs/planner/src/planner.c
+5
-4
未找到文件。
include/libs/planner/planner.h
浏览文件 @
032c9d7b
...
...
@@ -54,7 +54,7 @@ enum OPERATOR_TYPE_E {
struct
SEpSet
;
struct
SQueryPlanNode
;
struct
SQuery
Dist
PlanNode
;
struct
SQuery
Phy
PlanNode
;
struct
SQueryStmtInfo
;
typedef
struct
SSubquery
{
...
...
@@ -62,7 +62,7 @@ typedef struct SSubquery {
int32_t
type
;
// QUERY_TYPE_MERGE|QUERY_TYPE_PARTIAL
int32_t
level
;
// the execution level of current subquery, starting from 0.
SArray
*
pUpstream
;
// the upstream,from which to fetch the result
struct
SQuery
Dist
PlanNode
*
pNode
;
// physical plan of current subquery
struct
SQuery
Phy
PlanNode
*
pNode
;
// physical plan of current subquery
}
SSubquery
;
typedef
struct
SQueryJob
{
...
...
@@ -108,7 +108,7 @@ int32_t qQueryPlanToSql(struct SQueryPlanNode* pQueryNode, char** sql);
* @param pPhyNode
* @return
*/
int32_t
qCreatePhysicalPlan
(
struct
SQueryPlanNode
*
pQueryNode
,
struct
SEpSet
*
pQnode
,
struct
SQuery
Dist
PlanNode
*
pPhyNode
);
int32_t
qCreatePhysicalPlan
(
struct
SQueryPlanNode
*
pQueryNode
,
struct
SEpSet
*
pQnode
,
struct
SQuery
Phy
PlanNode
*
pPhyNode
);
/**
* Convert to physical plan to string to enable to print it out in the shell.
...
...
@@ -116,7 +116,7 @@ int32_t qCreatePhysicalPlan(struct SQueryPlanNode* pQueryNode, struct SEpSet* pQ
* @param str
* @return
*/
int32_t
qPhyPlanToString
(
struct
SQuery
Dist
PlanNode
*
pPhyNode
,
char
**
str
);
int32_t
qPhyPlanToString
(
struct
SQuery
Phy
PlanNode
*
pPhyNode
,
char
**
str
);
/**
* Destroy the query plan object.
...
...
@@ -129,7 +129,7 @@ void* qDestroyQueryPlan(struct SQueryPlanNode* pQueryNode);
* @param pQueryPhyNode
* @return
*/
void
*
qDestroyQueryPhyPlan
(
struct
SQuery
Dist
PlanNode
*
pQueryPhyNode
);
void
*
qDestroyQueryPhyPlan
(
struct
SQuery
Phy
PlanNode
*
pQueryPhyNode
);
/**
* Create the query job from the physical execution plan
...
...
@@ -137,7 +137,7 @@ void* qDestroyQueryPhyPlan(struct SQueryDistPlanNode* pQueryPhyNode);
* @param pJob
* @return
*/
int32_t
qCreateQueryJob
(
const
struct
SQuery
Dist
PlanNode
*
pPhyNode
,
struct
SQueryJob
**
pJob
);
int32_t
qCreateQueryJob
(
const
struct
SQuery
Phy
PlanNode
*
pPhyNode
,
struct
SQueryJob
**
pJob
);
#ifdef __cplusplus
}
...
...
source/libs/planner/inc/plannerInt.h
浏览文件 @
032c9d7b
...
...
@@ -57,20 +57,38 @@ typedef struct SQueryPlanNode {
struct
SQueryPlanNode
*
nextNode
;
}
SQueryPlanNode
;
typedef
struct
SQueryDistPlanNode
{
SQueryNodeBasicInfo
info
;
SSchema
*
pSchema
;
// the schema of the input SSDatablock
int32_t
numOfCols
;
// number of input columns
SArray
*
pExpr
;
// the query functions or sql aggregations
int32_t
numOfExpr
;
// number of result columns, which is also the number of pExprs
void
*
pExtInfo
;
// additional information
typedef
struct
SDataBlockSchema
{
int32_t
index
;
SSchema
*
pSchema
;
// the schema of the SSDatablock
int32_t
numOfCols
;
// number of columns
}
SDataBlockSchema
;
// previous operator to generated result for current node to process
// in case of join, multiple prev nodes exist.
SArray
*
pPrevNodes
;
// upstream nodes, or exchange operator to load data from multiple sources.
}
SQueryDistPlanNode
;
typedef
struct
SQueryCostSummary
{
typedef
struct
SQueryPhyPlanNode
{
SQueryNodeBasicInfo
info
;
SArray
*
pTarget
;
// target list to be computed at this node
SArray
*
qual
;
// implicitly-ANDed qual conditions
SDataBlockSchema
targetSchema
;
// children plan to generated result for current node to process
// in case of join, multiple plan nodes exist.
SArray
*
pChildren
;
}
SQueryPhyPlanNode
;
typedef
struct
SQueryScanPhyNode
{
SQueryPhyPlanNode
node
;
uint64_t
uid
;
}
SQueryScanPhyNode
;
typedef
struct
SQueryProjectPhyNode
{
SQueryPhyPlanNode
node
;
}
SQueryProjectPhyNode
;
typedef
struct
SQueryAggPhyNode
{
SQueryPhyPlanNode
node
;
SArray
*
pGroup
;
// SInterval
}
SQueryAggPhyNode
;
typedef
struct
SQueryProfileSummary
{
int64_t
startTs
;
// Object created and added into the message queue
int64_t
endTs
;
// the timestamp when the task is completed
int64_t
cputime
;
// total cpu cost, not execute elapsed time
...
...
@@ -91,14 +109,14 @@ typedef struct SQueryCostSummary {
uint32_t
loadBlockAgg
;
uint32_t
skipBlocks
;
uint64_t
resultSize
;
// generated result size in Kb.
}
SQuery
Cost
Summary
;
}
SQuery
Profile
Summary
;
typedef
struct
SQueryTask
{
uint64_t
queryId
;
// query id
uint64_t
taskId
;
// task id
SQuery
Dist
PlanNode
*
pNode
;
// operator tree
SQuery
Phy
PlanNode
*
pNode
;
// operator tree
uint64_t
status
;
// task status
SQuery
CostSummary
summary
;
// task execution summary
SQuery
ProfileSummary
summary
;
// task execution summary
void
*
pOutputHandle
;
// result buffer handle, to temporarily keep the output result for next stage
}
SQueryTask
;
...
...
source/libs/planner/src/planner.c
浏览文件 @
032c9d7b
...
...
@@ -66,11 +66,12 @@ int32_t qQueryPlanToSql(struct SQueryPlanNode* pQueryNode, char** sql) {
return
0
;
}
int32_t
qCreatePhysicalPlan
(
struct
SQueryPlanNode
*
pQueryNode
,
struct
SEpSet
*
pQnode
,
struct
SQueryDistPlanNode
*
pPhyNode
)
{
int32_t
qCreatePhysicalPlan
(
struct
SQueryPlanNode
*
pQueryNode
,
struct
SEpSet
*
pQnode
,
struct
SQueryPhyPlanNode
*
pPhyNode
)
{
return
0
;
}
int32_t
qPhyPlanToString
(
struct
SQuery
Dist
PlanNode
*
pPhyNode
,
char
**
str
)
{
int32_t
qPhyPlanToString
(
struct
SQuery
Phy
PlanNode
*
pPhyNode
,
char
**
str
)
{
return
0
;
}
...
...
@@ -83,11 +84,11 @@ void* qDestroyQueryPlan(SQueryPlanNode* pQueryNode) {
return
NULL
;
}
void
*
qDestroyQueryPhyPlan
(
struct
SQuery
Dist
PlanNode
*
pQueryPhyNode
)
{
void
*
qDestroyQueryPhyPlan
(
struct
SQuery
Phy
PlanNode
*
pQueryPhyNode
)
{
return
NULL
;
}
int32_t
qCreateQueryJob
(
const
struct
SQuery
Dist
PlanNode
*
pPhyNode
,
struct
SQueryJob
**
pJob
)
{
int32_t
qCreateQueryJob
(
const
struct
SQuery
Phy
PlanNode
*
pPhyNode
,
struct
SQueryJob
**
pJob
)
{
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录