Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
b446ece5
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,发现更多精彩内容 >>
提交
b446ece5
编写于
12月 23, 2016
作者:
D
Dhanashree Kashid
提交者:
GitHub
12月 23, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #129 from greenplum-db/wip_dbgprint
Included DbgPrint for CCostContext, CGroupExpression & COptimizationContext
上级
1e5d28e8
b4df84fe
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
103 addition
and
26 deletion
+103
-26
CMakeLists.txt
CMakeLists.txt
+1
-1
Makefile
Makefile
+1
-1
libgpopt/include/gpopt/base/CCostContext.h
libgpopt/include/gpopt/base/CCostContext.h
+5
-0
libgpopt/include/gpopt/base/COptimizationContext.h
libgpopt/include/gpopt/base/COptimizationContext.h
+14
-1
libgpopt/include/gpopt/operators/CExpression.h
libgpopt/include/gpopt/operators/CExpression.h
+0
-3
libgpopt/include/gpopt/search/CGroup.h
libgpopt/include/gpopt/search/CGroup.h
+4
-0
libgpopt/include/gpopt/search/CGroupExpression.h
libgpopt/include/gpopt/search/CGroupExpression.h
+9
-0
libgpopt/src/base/CCostContext.cpp
libgpopt/src/base/CCostContext.cpp
+9
-0
libgpopt/src/base/COptimizationContext.cpp
libgpopt/src/base/COptimizationContext.cpp
+12
-0
libgpopt/src/engine/CEngine.cpp
libgpopt/src/engine/CEngine.cpp
+5
-0
libgpopt/src/operators/CExpression.cpp
libgpopt/src/operators/CExpression.cpp
+0
-18
libgpopt/src/search/CGroup.cpp
libgpopt/src/search/CGroup.cpp
+22
-2
libgpopt/src/search/CGroupExpression.cpp
libgpopt/src/search/CGroupExpression.cpp
+19
-0
libgpopt/src/search/CJobGroupExpressionOptimization.cpp
libgpopt/src/search/CJobGroupExpressionOptimization.cpp
+1
-0
server/src/unittest/gpopt/search/COptimizationJobsTest.cpp
server/src/unittest/gpopt/search/COptimizationJobsTest.cpp
+1
-0
未找到文件。
CMakeLists.txt
浏览文件 @
b446ece5
...
...
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project
(
gpopt LANGUAGES CXX C
)
set
(
GPORCA_VERSION_MAJOR 1
)
set
(
GPORCA_VERSION_MINOR 69
6
)
set
(
GPORCA_VERSION_MINOR 69
7
)
set
(
GPORCA_VERSION_STRING
${
GPORCA_VERSION_MAJOR
}
.
${
GPORCA_VERSION_MINOR
}
)
# Whenever an ABI-breaking change is made to GPORCA, this should be incremented.
...
...
Makefile
浏览文件 @
b446ece5
...
...
@@ -10,7 +10,7 @@ BLD_TOP := $(shell sh -c pwd)
include
make/gpo.mk
LIB_NAME
=
optimizer
LIB_VERSION
=
1.69
6
LIB_VERSION
=
1.69
7
## ----------------------------------------------------------------------
## top level variables; only used in this makefile
## ----------------------------------------------------------------------
...
...
libgpopt/include/gpopt/base/CCostContext.h
浏览文件 @
b446ece5
...
...
@@ -307,6 +307,11 @@ namespace gpopt
virtual
IOstream
&
OsPrint
(
IOstream
&
os
)
const
;
#ifdef GPOS_DEBUG
// debug print; for interactive debugging sessions only
void
DbgPrint
();
#endif
};
// class CCostContext
...
...
libgpopt/include/gpopt/base/COptimizationContext.h
浏览文件 @
b446ece5
...
...
@@ -18,6 +18,7 @@
#include "gpopt/base/CReqdPropPlan.h"
#include "gpopt/search/CJobQueue.h"
#include "naucrates/statistics/IStatistics.h"
#include "gpos/task/CAutoTraceFlag.h"
#define GPOPT_INVALID_OPTCTXT_ID ULONG_MAX
...
...
@@ -64,6 +65,9 @@ namespace gpopt
private:
// memory pool
IMemoryPool
*
m_pmp
;
// private copy ctor
COptimizationContext
(
const
COptimizationContext
&
);
...
...
@@ -103,6 +107,7 @@ namespace gpopt
// private dummy ctor; used for creating invalid context
COptimizationContext
()
:
m_pmp
(
NULL
),
m_ulId
(
GPOPT_INVALID_OPTCTXT_ID
),
m_pgroup
(
NULL
),
m_prpp
(
NULL
),
...
...
@@ -135,6 +140,7 @@ namespace gpopt
// ctor
COptimizationContext
(
IMemoryPool
*
pmp
,
CGroup
*
pgroup
,
CReqdPropPlan
*
prpp
,
CReqdPropRelational
*
prprel
,
// required relational props -- used during stats derivation
...
...
@@ -142,6 +148,7 @@ namespace gpopt
ULONG
ulSearchStageIndex
)
:
m_pmp
(
pmp
),
m_ulId
(
GPOPT_INVALID_OPTCTXT_ID
),
m_pgroup
(
pgroup
),
m_prpp
(
prpp
),
...
...
@@ -265,7 +272,8 @@ namespace gpopt
// debug print
virtual
IOstream
&
OsPrint
(
IOstream
&
os
,
const
CHAR
*
szPrefix
)
const
;
IOstream
&
OsPrint
(
IOstream
&
os
,
const
CHAR
*
szPrefix
)
const
;
// check equality of optimization contexts
static
...
...
@@ -361,6 +369,11 @@ namespace gpopt
static
const
OPTCTXT_PTR
m_pocInvalid
;
#ifdef GPOS_DEBUG
// debug print; for interactive debugging sessions only
void
DbgPrint
();
#endif // GPOS_DEBUG
};
// class COptimizationContext
}
...
...
libgpopt/include/gpopt/operators/CExpression.h
浏览文件 @
b446ece5
...
...
@@ -299,9 +299,6 @@ namespace gpopt
// debug print; for interactive debugging sessions only
void
DbgPrint
()
const
;
// debug print; for interactive debugging sessions only
void
DbgPrintProps
()
const
;
#endif // GPOS_DEBUG
// check if the expression satisfies given required properties
...
...
libgpopt/include/gpopt/search/CGroup.h
浏览文件 @
b446ece5
...
...
@@ -625,6 +625,10 @@ namespace gpopt
// slink for group list in memo
SLink
m_link
;
#ifdef GPOS_DEBUG
// debug print; for interactive debugging sessions only
void
DbgPrint
();
#endif
};
// class CGroup
...
...
libgpopt/include/gpopt/search/CGroupExpression.h
浏览文件 @
b446ece5
...
...
@@ -44,6 +44,11 @@ namespace gpopt
public:
#ifdef GPOS_DEBUG
// debug print; for interactive debugging sessions only
void
DbgPrint
();
#endif // GPOS_DEBUG
// states of a group expression
enum
EState
{
...
...
@@ -67,6 +72,9 @@ namespace gpopt
private:
// memory pool
IMemoryPool
*
m_pmp
;
// definition of context hash table accessor
typedef
CSyncHashtableAccessByKey
<
...
...
@@ -189,6 +197,7 @@ namespace gpopt
//private dummy ctor; used for creating invalid gexpr
CGroupExpression
()
:
m_pmp
(
NULL
),
m_ulId
(
GPOPT_INVALID_GEXPR_ID
),
m_pop
(
NULL
),
m_pdrgpgroup
(
NULL
),
...
...
libgpopt/src/base/CCostContext.cpp
浏览文件 @
b446ece5
...
...
@@ -672,5 +672,14 @@ CCostContext::OsPrint
return
os
<<
std
::
endl
;
}
#ifdef GPOS_DEBUG
void
CCostContext
::
DbgPrint
()
{
CAutoTrace
at
(
m_pmp
);
(
void
)
this
->
OsPrint
(
at
.
Os
());
}
#endif // GPOS_DEBUG
// EOF
libgpopt/src/base/COptimizationContext.cpp
浏览文件 @
b446ece5
...
...
@@ -33,6 +33,7 @@ const COptimizationContext COptimizationContext::m_ocInvalid;
const
OPTCTXT_PTR
COptimizationContext
::
m_pocInvalid
=
NULL
;
//---------------------------------------------------------------------------
// @function:
// COptimizationContext::~COptimizationContext
...
...
@@ -475,6 +476,7 @@ COptimizationContext::OsPrint
)
const
{
os
<<
szPrefix
<<
m_ulId
<<
" (stage "
<<
m_ulSearchStageIndex
<<
"): ("
<<
*
m_prpp
<<
") => Best Expr:"
;
if
(
NULL
!=
PgexprBest
())
{
...
...
@@ -485,5 +487,15 @@ COptimizationContext::OsPrint
return
os
;
}
#ifdef GPOS_DEBUG
void
COptimizationContext
::
DbgPrint
()
{
CAutoTraceFlag
atf
(
EopttracePrintOptCtxt
,
true
);
CAutoTrace
at
(
m_pmp
);
(
void
)
this
->
OsPrint
(
at
.
Os
(),
" "
);
}
#endif // GPOS_DEBUG
// EOF
libgpopt/src/engine/CEngine.cpp
浏览文件 @
b446ece5
...
...
@@ -691,6 +691,7 @@ CEngine::Pmemotmap()
m_pqc
->
Prpp
()
->
AddRef
();
COptimizationContext
*
poc
=
GPOS_NEW
(
m_pmp
)
COptimizationContext
(
m_pmp
,
PgroupRoot
(),
m_pqc
->
Prpp
(),
GPOS_NEW
(
m_pmp
)
CReqdPropRelational
(
GPOS_NEW
(
m_pmp
)
CColRefSet
(
m_pmp
)),
// pass empty required relational properties initially
...
...
@@ -961,6 +962,7 @@ CEngine::PocChild
COptimizationContext
*
pocChild
=
GPOS_NEW
(
m_pmp
)
COptimizationContext
(
m_pmp
,
pgroupChild
,
exprhdlPlan
.
Prpp
(
ulChildIndex
),
prprel
,
...
...
@@ -1343,6 +1345,7 @@ CEngine::RecursiveOptimize()
COptimizationContext
*
poc
=
GPOS_NEW
(
m_pmp
)
COptimizationContext
(
m_pmp
,
PgroupRoot
(),
m_pqc
->
Prpp
(),
GPOS_NEW
(
m_pmp
)
CReqdPropRelational
(
GPOS_NEW
(
m_pmp
)
CColRefSet
(
m_pmp
)),
// pass empty required relational properties initially
...
...
@@ -1727,6 +1730,7 @@ CEngine::MainThreadOptimize()
m_pqc
->
Prpp
()
->
AddRef
();
COptimizationContext
*
poc
=
GPOS_NEW
(
m_pmp
)
COptimizationContext
(
m_pmp
,
PgroupRoot
(),
m_pqc
->
Prpp
(),
GPOS_NEW
(
m_pmp
)
CReqdPropRelational
(
GPOS_NEW
(
m_pmp
)
CColRefSet
(
m_pmp
)),
// pass empty required relational properties initially
...
...
@@ -1791,6 +1795,7 @@ CEngine::MultiThreadedOptimize
m_pqc
->
Prpp
()
->
AddRef
();
COptimizationContext
*
poc
=
GPOS_NEW
(
m_pmp
)
COptimizationContext
(
m_pmp
,
PgroupRoot
(),
m_pqc
->
Prpp
(),
GPOS_NEW
(
m_pmp
)
CReqdPropRelational
(
GPOS_NEW
(
m_pmp
)
CColRefSet
(
m_pmp
)),
// pass empty required relational properties initially
...
...
libgpopt/src/operators/CExpression.cpp
浏览文件 @
b446ece5
...
...
@@ -1201,24 +1201,6 @@ CExpression::DbgPrint() const
(
void
)
this
->
OsPrint
(
at
.
Os
());
}
//---------------------------------------------------------------------------
// @function:
// CExpression::DbgPrintProps
//
// @doc:
// Print driving function for use in interactive debugging;
// always prints to stderr;
// the output includes properties and stats
//
//---------------------------------------------------------------------------
void
CExpression
::
DbgPrintProps
()
const
{
CAutoTraceFlag
atf
(
EopttracePrintExprProps
,
true
);
CAutoTrace
at
(
m_pmp
);
(
void
)
this
->
OsPrint
(
at
.
Os
());
}
#endif // GPOS_DEBUG
//---------------------------------------------------------------------------
...
...
libgpopt/src/search/CGroup.cpp
浏览文件 @
b446ece5
...
...
@@ -11,9 +11,9 @@
#include "gpos/base.h"
#include "gpos/task/CAutoSuspendAbort.h"
#include "gpos/task/CAutoTraceFlag.h"
#include "gpos/task/CWorker.h"
#include "gpopt/base/CDrvdProp.h"
#include "gpopt/base/CDrvdPropCtxtPlan.h"
#include "gpopt/base/CDrvdPropCtxtRelational.h"
...
...
@@ -288,7 +288,7 @@ CGroup::CleanupContexts()
}
#ifdef GPOS_DEBUG
CWorker
::
PwrkrSelf
()
->
ResetTimeSlice
();
CWorker
::
PwrkrSelf
()
->
ResetTimeSlice
();
#endif // GPOS_DEBUG
}
...
...
@@ -353,6 +353,7 @@ CGroup::PocLookup
prpp
->
AddRef
();
COptimizationContext
*
poc
=
GPOS_NEW
(
pmp
)
COptimizationContext
(
pmp
,
this
,
prpp
,
GPOS_NEW
(
pmp
)
CReqdPropRelational
(
GPOS_NEW
(
pmp
)
CColRefSet
(
pmp
)),
// required relational props is not used when looking up contexts
...
...
@@ -1111,6 +1112,7 @@ CGroup::CreateDummyCostContext()
COptimizationContext
*
poc
=
GPOS_NEW
(
m_pmp
)
COptimizationContext
(
m_pmp
,
this
,
CReqdPropPlan
::
PrppEmpty
(
m_pmp
),
GPOS_NEW
(
m_pmp
)
CReqdPropRelational
(
GPOS_NEW
(
m_pmp
)
CColRefSet
(
m_pmp
)),
...
...
@@ -2186,6 +2188,24 @@ CGroup::CostLowerBound
return
costLowerBound
;
}
#ifdef GPOS_DEBUG
//---------------------------------------------------------------------------
// @function:
// CGroup::DbgPrint
//
// @doc:
// Print driving function for use in interactive debugging;
// always prints to stderr;
//
//---------------------------------------------------------------------------
void
CGroup
::
DbgPrint
()
{
CAutoTraceFlag
atf
(
EopttracePrintGrpProps
,
true
);
CAutoTrace
at
(
m_pmp
);
(
void
)
this
->
OsPrint
(
at
.
Os
());
}
#endif
// EOF
libgpopt/src/search/CGroupExpression.cpp
浏览文件 @
b446ece5
...
...
@@ -54,6 +54,7 @@ CGroupExpression::CGroupExpression
BOOL
fIntermediate
)
:
m_pmp
(
pmp
),
m_ulId
(
GPOPT_INVALID_GEXPR_ID
),
m_pgexprDuplicate
(
NULL
),
m_pop
(
pop
),
...
...
@@ -1186,5 +1187,23 @@ CGroupExpression::OsPrint
return
os
;
}
#ifdef GPOS_DEBUG
//---------------------------------------------------------------------------
// @function:
// CGroupExpression::DbgPrint
//
// @doc:
// Print driving function for use in interactive debugging;
// always prints to stderr;
//
//---------------------------------------------------------------------------
void
CGroupExpression
::
DbgPrint
()
{
CAutoTraceFlag
atf
(
EopttracePrintGrpProps
,
true
);
CAutoTrace
at
(
m_pmp
);
(
void
)
this
->
OsPrint
(
at
.
Os
());
}
#endif // GPOS_DEBUG
// EOF
libgpopt/src/search/CJobGroupExpressionOptimization.cpp
浏览文件 @
b446ece5
...
...
@@ -421,6 +421,7 @@ CJobGroupExpressionOptimization::ScheduleChildGroupsJobs
// schedule optimization job for current child group
COptimizationContext
*
pocChild
=
GPOS_NEW
(
psc
->
PmpGlobal
())
COptimizationContext
(
psc
->
PmpGlobal
(),
pgroupChild
,
m_pexprhdlPlan
->
Prpp
(
m_ulChildIndex
),
prprel
,
...
...
server/src/unittest/gpopt/search/COptimizationJobsTest.cpp
浏览文件 @
b446ece5
...
...
@@ -92,6 +92,7 @@ COptimizationJobsTest::EresUnittest_StateMachine()
pqc
->
Prpp
()
->
AddRef
();
COptimizationContext
*
poc
=
GPOS_NEW
(
pmp
)
COptimizationContext
(
pmp
,
pgroup
,
pqc
->
Prpp
(),
GPOS_NEW
(
pmp
)
CReqdPropRelational
(
GPOS_NEW
(
pmp
)
CColRefSet
(
pmp
)),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录