当前位置: 首页>>代码示例>>C++>>正文


C++ CConstraint::PcrsUsed方法代码示例

本文整理汇总了C++中CConstraint::PcrsUsed方法的典型用法代码示例。如果您正苦于以下问题:C++ CConstraint::PcrsUsed方法的具体用法?C++ CConstraint::PcrsUsed怎么用?C++ CConstraint::PcrsUsed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CConstraint的用法示例。


在下文中一共展示了CConstraint::PcrsUsed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DrgPcnstr

//---------------------------------------------------------------------------
//	@function:
//		CConstraint::PdrgpcnstrOnColumn
//
//	@doc:
//		Return a subset of the given constraints which reference the
//		given column
//
//---------------------------------------------------------------------------
DrgPcnstr *
CConstraint::PdrgpcnstrOnColumn
(
    IMemoryPool *pmp,
    DrgPcnstr *pdrgpcnstr,
    CColRef *pcr,
    BOOL fExclusive		// returned constraints must reference ONLY the given col
)
{
    DrgPcnstr *pdrgpcnstrSubset = GPOS_NEW(pmp) DrgPcnstr(pmp);

    const ULONG ulLen = pdrgpcnstr->UlLength();

    for (ULONG ul = 0; ul < ulLen; ul++)
    {
        CConstraint *pcnstr = (*pdrgpcnstr)[ul];
        CColRefSet *pcrs = pcnstr->PcrsUsed();

        // if the fExclusive flag is true, then pcr must be the only column
        if (pcrs->FMember(pcr) && (!fExclusive || 1 == pcrs->CElements()))
        {
            pcnstr->AddRef();
            pdrgpcnstrSubset->Append(pcnstr);
        }
    }

    return pdrgpcnstrSubset;
}
开发者ID:hsyuan,项目名称:gporca,代码行数:37,代码来源:CConstraint.cpp

示例2: PdrgpcnstrFlatten

//---------------------------------------------------------------------------
//	@function:
//		CConstraintConjunction::CConstraintConjunction
//
//	@doc:
//		Ctor
//
//---------------------------------------------------------------------------
CConstraintConjunction::CConstraintConjunction
	(
	IMemoryPool *mp,
	CConstraintArray *pdrgpcnstr
	)
	:
	CConstraint(mp),
	m_pdrgpcnstr(NULL)
{
	GPOS_ASSERT(NULL != pdrgpcnstr);
	m_pdrgpcnstr = PdrgpcnstrFlatten(mp, pdrgpcnstr, EctConjunction);

	const ULONG length = m_pdrgpcnstr->Size();
	GPOS_ASSERT(0 < length);

	m_pcrsUsed = GPOS_NEW(mp) CColRefSet(mp);

	for (ULONG ul = 0; ul < length; ul++)
	{
		CConstraint *pcnstr = (*m_pdrgpcnstr)[ul];
		m_pcrsUsed->Include(pcnstr->PcrsUsed());
	}

	m_phmcolconstr = Phmcolconstr(mp, m_pcrsUsed, m_pdrgpcnstr);
}
开发者ID:b-xiang,项目名称:gporca,代码行数:33,代码来源:CConstraintConjunction.cpp

示例3: arpdrgpcnstr

// mapping between columns and single column constraints in array of constraints
static
HMColConstr *
PhmcolconstrSingleColConstr
	(
		IMemoryPool *pmp,
		DrgPcnstr *drgPcnstr
	)
{
	CAutoRef<DrgPcnstr> arpdrgpcnstr(drgPcnstr);
	HMColConstr *phmcolconstr = GPOS_NEW(pmp) HMColConstr(pmp);

	const ULONG ulLen = arpdrgpcnstr->UlLength();

	for (ULONG ul = 0; ul < ulLen; ul++)
	{
		CConstraint *pcnstrChild = (*arpdrgpcnstr)[ul];
		CColRefSet *pcrs = pcnstrChild->PcrsUsed();

		if (1 == pcrs->CElements())
		{
			CColRef *pcr = pcrs->PcrFirst();
			DrgPcnstr *pcnstrMapped = phmcolconstr->PtLookup(pcr);
			if (NULL == pcnstrMapped)
			{
				pcnstrMapped = GPOS_NEW(pmp) DrgPcnstr(pmp);
				phmcolconstr->FInsert(pcr, pcnstrMapped);
			}
			pcnstrChild->AddRef();
			pcnstrMapped->Append(pcnstrChild);
		}
	}

	return phmcolconstr;
}
开发者ID:MoZhonghua,项目名称:gporca,代码行数:35,代码来源:CColConstraintsHashMapper.cpp

示例4: PcnstrConjunction

//---------------------------------------------------------------------------
//	@function:
//		CConstraintConjunction::Pcnstr
//
//	@doc:
//		Return constraint on a given column set
//
//---------------------------------------------------------------------------
CConstraint *
CConstraintConjunction::Pcnstr
	(
	IMemoryPool *mp,
	CColRefSet *pcrs
	)
{
	const ULONG length = m_pdrgpcnstr->Size();

	CConstraintArray *pdrgpcnstr = GPOS_NEW(mp) CConstraintArray(mp);

	for (ULONG ul = 0; ul < length; ul++)
	{
		CConstraint *pcnstr = (*m_pdrgpcnstr)[ul];
		if (pcnstr->PcrsUsed()->IsDisjoint(pcrs))
		{
			continue;
		}

		// the part of the child that references these columns
		CConstraint *pcnstrCol = pcnstr->Pcnstr(mp, pcrs);
		if (NULL != pcnstrCol)
		{
			pdrgpcnstr->Append(pcnstrCol);
		}
	}

	return CConstraint::PcnstrConjunction(mp, pdrgpcnstr);
}
开发者ID:b-xiang,项目名称:gporca,代码行数:37,代码来源:CConstraintConjunction.cpp


注:本文中的CConstraint::PcrsUsed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。