本文整理汇总了C++中IStatistics::PstatsLASJoin方法的典型用法代码示例。如果您正苦于以下问题:C++ IStatistics::PstatsLASJoin方法的具体用法?C++ IStatistics::PstatsLASJoin怎么用?C++ IStatistics::PstatsLASJoin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStatistics
的用法示例。
在下文中一共展示了IStatistics::PstatsLASJoin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrgPcrs
//---------------------------------------------------------------------------
// @function:
// CLogicalDifferenceAll::PstatsDerive
//
// @doc:
// Derive statistics
//
//---------------------------------------------------------------------------
IStatistics *
CLogicalDifferenceAll::PstatsDerive
(
IMemoryPool *pmp,
CExpressionHandle &exprhdl,
DrgPstat * // not used
)
const
{
GPOS_ASSERT(Esp(exprhdl) > EspNone);
// difference all is transformed into 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();
pdrgpcrsOutput->Release();
return pstatsLASJ;
}
示例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;
}