本文整理汇总了C++中IStatistics::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ IStatistics::Release方法的具体用法?C++ IStatistics::Release怎么用?C++ IStatistics::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStatistics
的用法示例。
在下文中一共展示了IStatistics::Release方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrgPul
//---------------------------------------------------------------------------
// @function:
// CLogicalUnion::PstatsDerive
//
// @doc:
// Derive statistics
//
//---------------------------------------------------------------------------
IStatistics *
CLogicalUnion::PstatsDerive
(
IMemoryPool *pmp,
CExpressionHandle &exprhdl,
DrgPstat * // not used
)
const
{
GPOS_ASSERT(Esp(exprhdl) > EspNone);
// union is transformed into a group by over an union all
// we follow the same route to compute statistics
IStatistics *pstatsUnionAll = CLogicalUnionAll::PstatsDeriveUnionAll(pmp, exprhdl);
// computed columns
DrgPul *pdrgpulComputedCols = GPOS_NEW(pmp) DrgPul(pmp);
IStatistics *pstats = CLogicalGbAgg::PstatsDerive
(
pmp,
pstatsUnionAll,
m_pdrgpcrOutput, // we group by the output columns
pdrgpulComputedCols, // no computed columns for set ops
NULL // no keys, use all grouping cols
);
// clean up
pdrgpulComputedCols->Release();
pstatsUnionAll->Release();
return pstats;
}
示例2: DrgPcrs
//---------------------------------------------------------------------------
// @function:
// CLogicalDifference::PstatsDerive
//
// @doc:
// Derive statistics
//
//---------------------------------------------------------------------------
IStatistics *
CLogicalDifference::PstatsDerive
(
IMemoryPool *pmp,
CExpressionHandle &exprhdl,
DrgPstat * // not used
)
const
{
GPOS_ASSERT(Esp(exprhdl) > EspNone);
// difference is transformed into an aggregate over a LASJ,
// we follow the same route to compute statistics
DrgPcrs *pdrgpcrsOutput = GPOS_NEW(pmp) DrgPcrs(pmp);
const ULONG ulSize = m_pdrgpdrgpcrInput->UlLength();
for (ULONG ul = 0; ul < ulSize; ul++)
{
CColRefSet *pcrs = GPOS_NEW(pmp) CColRefSet(pmp, (*m_pdrgpdrgpcrInput)[ul]);
pdrgpcrsOutput->Append(pcrs);
}
IStatistics *pstatsOuter = exprhdl.Pstats(0);
IStatistics *pstatsInner = exprhdl.Pstats(1);
// construct the scalar condition for the LASJ
CExpression *pexprScCond = CUtils::PexprConjINDFCond(pmp, m_pdrgpdrgpcrInput);
// compute the statistics for LASJ
CColRefSet *pcrsOuterRefs = exprhdl.Pdprel()->PcrsOuter();
DrgPstatsjoin *pdrgpstatsjoin = CStatsPredUtils::Pdrgpstatsjoin
(
pmp,
exprhdl,
pexprScCond,
pdrgpcrsOutput,
pcrsOuterRefs
);
IStatistics *pstatsLASJ = pstatsOuter->PstatsLASJoin
(
pmp,
pstatsInner,
pdrgpstatsjoin,
true /* fIgnoreLasjHistComputation */
);
// clean up
pexprScCond->Release();
pdrgpstatsjoin->Release();
// computed columns
DrgPul *pdrgpulComputedCols = GPOS_NEW(pmp) DrgPul(pmp);
IStatistics *pstats = CLogicalGbAgg::PstatsDerive
(
pmp,
pstatsLASJ,
(*m_pdrgpdrgpcrInput)[0], // we group by the columns of the first child
pdrgpulComputedCols, // no computed columns for set ops
NULL // no keys, use all grouping cols
);
// clean up
pdrgpulComputedCols->Release();
pstatsLASJ->Release();
pdrgpcrsOutput->Release();
return pstats;
}
示例3: 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;
}