本文整理汇总了C++中IStatistics::Pcrs方法的典型用法代码示例。如果您正苦于以下问题:C++ IStatistics::Pcrs方法的具体用法?C++ IStatistics::Pcrs怎么用?C++ IStatistics::Pcrs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStatistics
的用法示例。
在下文中一共展示了IStatistics::Pcrs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GPOS_NEW
//---------------------------------------------------------------------------
// @function:
// CExpressionHandle::PdrgpstatOuterRefs
//
// @doc:
// Given an array of stats objects and a child index, return an array
// of stats objects starting from the first stats object referenced by
// child
//
//---------------------------------------------------------------------------
DrgPstat *
CExpressionHandle::PdrgpstatOuterRefs
(
DrgPstat *pdrgpstat,
ULONG ulChildIndex
)
const
{
GPOS_ASSERT(NULL != pdrgpstat);
GPOS_ASSERT(ulChildIndex < UlArity());
if (FScalarChild(ulChildIndex) || !FHasOuterRefs(ulChildIndex))
{
// if child is scalar or has no outer references, return empty array
return GPOS_NEW(m_pmp) DrgPstat(m_pmp);
}
DrgPstat *pdrgpstatResult = GPOS_NEW(m_pmp) DrgPstat(m_pmp);
CColRefSet *pcrsOuter = Pdprel(ulChildIndex)->PcrsOuter();
GPOS_ASSERT(0 < pcrsOuter->CElements());
const ULONG ulSize = pdrgpstat->UlLength();
ULONG ulStartIndex = ULONG_MAX;
for (ULONG ul = 0; ul < ulSize; ul++)
{
IStatistics *pstats = (*pdrgpstat)[ul];
CColRefSet *pcrsStats = pstats->Pcrs(m_pmp);
BOOL fStatsColsUsed = !pcrsOuter->FDisjoint(pcrsStats);
pcrsStats->Release();
if (fStatsColsUsed)
{
ulStartIndex = ul;
break;
}
}
if (ULONG_MAX != ulStartIndex)
{
// copy stats starting from index of outer-most stats object referenced by child
CUtils::AddRefAppend<IStatistics, CleanupStats>(pdrgpstatResult, pdrgpstat, ulStartIndex);
}
return pdrgpstatResult;
}