本文整理汇总了C++中IStatistics::PstatsFilter方法的典型用法代码示例。如果您正苦于以下问题:C++ IStatistics::PstatsFilter方法的具体用法?C++ IStatistics::PstatsFilter怎么用?C++ IStatistics::PstatsFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStatistics
的用法示例。
在下文中一共展示了IStatistics::PstatsFilter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//---------------------------------------------------------------------------
// @function:
// CLogicalDynamicGetBase::PstatsDeriveFilter
//
// @doc:
// Derive stats from base table using filters on partition and/or index columns
//
//---------------------------------------------------------------------------
IStatistics *
CLogicalDynamicGetBase::PstatsDeriveFilter
(
IMemoryPool *pmp,
CExpressionHandle &exprhdl,
CExpression *pexprFilter
)
const
{
CExpression *pexprFilterNew = NULL;
CConstraint *pcnstr = m_ppartcnstr->PcnstrCombined();
if (m_fPartial && NULL != pcnstr && !pcnstr->FUnbounded())
{
if (NULL == pexprFilter)
{
pexprFilterNew = pcnstr->PexprScalar(pmp);
pexprFilterNew->AddRef();
}
else
{
pexprFilterNew = CPredicateUtils::PexprConjunction(pmp, pexprFilter, pcnstr->PexprScalar(pmp));
}
}
else if (NULL != pexprFilter)
{
pexprFilterNew = pexprFilter;
pexprFilterNew->AddRef();
}
CColRefSet *pcrsStat = GPOS_NEW(pmp) CColRefSet(pmp);
CDrvdPropScalar *pdpscalar = NULL;
if (NULL != pexprFilterNew)
{
pdpscalar = CDrvdPropScalar::Pdpscalar(pexprFilterNew->PdpDerive());
pcrsStat->Include(pdpscalar->PcrsUsed());
}
// requesting statistics on distribution columns to estimate data skew
if (NULL != m_pcrsDist)
{
pcrsStat->Include(m_pcrsDist);
}
IStatistics *pstatsFullTable = PstatsBaseTable(pmp, exprhdl, m_ptabdesc, pcrsStat);
pcrsStat->Release();
if (NULL == pexprFilterNew || pdpscalar->FHasSubquery())
{
return pstatsFullTable;
}
CStatsPred *pstatspred = CStatsPredUtils::PstatspredExtract
(
pmp,
pexprFilterNew,
NULL /*pcrsOuterRefs*/
);
pexprFilterNew->Release();
IStatistics *pstatsResult = pstatsFullTable->PstatsFilter
(
pmp,
pstatspred,
true /* fCapNdvs */
);
pstatspred->Release();
pstatsFullTable->Release();
return pstatsResult;
}