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


C++ CExpressionHandle::GetRelationalProperties方法代码示例

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


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

示例1:

//---------------------------------------------------------------------------
//	@function:
//		CLogicalUnion::Maxcard
//
//	@doc:
//		Derive max card
//
//---------------------------------------------------------------------------
CMaxCard
CLogicalUnion::Maxcard
	(
	IMemoryPool *, // mp
	CExpressionHandle &exprhdl
	)
	const
{
	const ULONG arity = exprhdl.Arity();
	
	CMaxCard maxcard = exprhdl.GetRelationalProperties(0)->Maxcard();
	for (ULONG ul = 1; ul < arity; ul++)
	{
		maxcard += exprhdl.GetRelationalProperties(ul)->Maxcard();
	}
	
	return maxcard;
}
开发者ID:b-xiang,项目名称:gporca,代码行数:26,代码来源:CLogicalUnion.cpp

示例2: Maxcard

//---------------------------------------------------------------------------
//	@function:
//		CLogicalLeftSemiApply::Maxcard
//
//	@doc:
//		Derive max card
//
//---------------------------------------------------------------------------
CMaxCard
CLogicalLeftSemiApply::Maxcard
	(
	IMemoryPool *, // mp
	CExpressionHandle &exprhdl
	)
	const
{
	return CLogical::Maxcard(exprhdl, 2 /*ulScalarIndex*/, exprhdl.GetRelationalProperties(0)->Maxcard());
}
开发者ID:b-xiang,项目名称:gporca,代码行数:18,代码来源:CLogicalLeftSemiApply.cpp

示例3:

//---------------------------------------------------------------------------
//	@function:
//		CLogicalSequence::Maxcard
//
//	@doc:
//		Derive max card
//
//---------------------------------------------------------------------------
CMaxCard
CLogicalSequence::Maxcard
	(
	IMemoryPool *, // mp
	CExpressionHandle &exprhdl
	)
	const
{
	// pass on max card of last child
	return exprhdl.GetRelationalProperties(exprhdl.Arity() - 1)->Maxcard();
}
开发者ID:b-xiang,项目名称:gporca,代码行数:19,代码来源:CLogicalSequence.cpp

示例4:

//---------------------------------------------------------------------------
//	@function:
//		CLogicalSequenceProject::Maxcard
//
//	@doc:
//		Derive max card
//
//---------------------------------------------------------------------------
CMaxCard
CLogicalSequenceProject::Maxcard
	(
	IMemoryPool *, // mp
	CExpressionHandle &exprhdl
	)
	const
{
	// pass on max card of first child
	return exprhdl.GetRelationalProperties(0)->Maxcard();
}
开发者ID:b-xiang,项目名称:gporca,代码行数:19,代码来源:CLogicalSequenceProject.cpp

示例5:

//---------------------------------------------------------------------------
//	@function:
//		CPhysical::FUnaryProvidesReqdCols
//
//	@doc:
//		Helper for checking if output columns of a unary operator that defines
//		no new columns include the required columns
//
//---------------------------------------------------------------------------
BOOL
CPhysical::FUnaryProvidesReqdCols
	(
	CExpressionHandle &exprhdl,
	CColRefSet *pcrsRequired
	)
{
	GPOS_ASSERT(NULL != pcrsRequired);

	CColRefSet *pcrsOutput = exprhdl.GetRelationalProperties(0 /*child_index*/)->PcrsOutput();

	return pcrsOutput->ContainsAll(pcrsRequired);
}
开发者ID:b-xiang,项目名称:gporca,代码行数:22,代码来源:CPhysical.cpp

示例6:

//---------------------------------------------------------------------------
//	@function:
//		CXformLeftSemiJoin2InnerJoin::Exfp
//
//	@doc:
//		Compute xform promise for a given expression handle;
//
//---------------------------------------------------------------------------
CXform::EXformPromise
CXformLeftSemiJoin2InnerJoin::Exfp
	(
	CExpressionHandle &exprhdl
	)
	const
{
	if (exprhdl.HasOuterRefs() || exprhdl.GetDrvdScalarProps(2)->FHasSubquery())
	{
		return ExfpNone;
	}

	CColRefSet *pcrsInnerOutput = exprhdl.GetRelationalProperties(1 /*child_index*/)->PcrsOutput();
	CExpression *pexprScalar = exprhdl.PexprScalarChild(2 /*child_index*/);
	CAutoMemoryPool amp;

	// examine join predicate to determine xform applicability
	if (!CPredicateUtils::FSimpleEqualityUsingCols(amp.Pmp(), pexprScalar, pcrsInnerOutput))
	{
		return ExfpNone;
	}

	return ExfpHigh;
}
开发者ID:b-xiang,项目名称:gporca,代码行数:32,代码来源:CXformLeftSemiJoin2InnerJoin.cpp

示例7: CColRefSet

//---------------------------------------------------------------------------
//	@function:
//		CPhysicalPartitionSelectorDML::FProvidesReqdCols
//
//	@doc:
//		Check if required columns are included in output columns
//
//---------------------------------------------------------------------------
BOOL
CPhysicalPartitionSelectorDML::FProvidesReqdCols
	(
	CExpressionHandle &exprhdl,
	CColRefSet *pcrsRequired,
	ULONG // ulOptReq
	)
	const
{
	GPOS_ASSERT(NULL != pcrsRequired);
	GPOS_ASSERT(1 == exprhdl.Arity());

	CColRefSet *pcrs = GPOS_NEW(m_mp) CColRefSet(m_mp);
	// include the defined oid column
	pcrs->Include(m_pcrOid);

	// include output columns of the relational child
	pcrs->Union(exprhdl.GetRelationalProperties(0 /*child_index*/)->PcrsOutput());

	BOOL fProvidesCols = pcrs->ContainsAll(pcrsRequired);
	pcrs->Release();

	return fProvidesCols;
}
开发者ID:b-xiang,项目名称:gporca,代码行数:32,代码来源:CPhysicalPartitionSelectorDML.cpp

示例8:

//---------------------------------------------------------------------------
//	@function:
//		CPhysicalUnionAll::EpetPartitionPropagation
//
//	@doc:
//		Compute the enforcing type for the operator
//
//---------------------------------------------------------------------------
CEnfdProp::EPropEnforcingType
CPhysicalUnionAll::EpetPartitionPropagation
	(
		CExpressionHandle &exprhdl,
		const CEnfdPartitionPropagation *pepp
	)
const
{
	CPartIndexMap *ppimReqd = pepp->PppsRequired()->Ppim();
	if (!ppimReqd->FContainsUnresolved())
	{
		// no unresolved partition consumers left
		return CEnfdProp::EpetUnnecessary;
	}

	CPartIndexMap *ppimDrvd = CDrvdPropPlan::Pdpplan(exprhdl.Pdp())->Ppim();
	GPOS_ASSERT(NULL != ppimDrvd);

	BOOL fInScope = pepp->FInScope(m_mp, ppimDrvd);
	BOOL fResolved = pepp->FResolved(m_mp, ppimDrvd);

	if (fResolved)
	{
		// all required partition consumers are resolved
		return CEnfdProp::EpetUnnecessary;
	}

	if (!fInScope)
	{
		// some partition consumers are not covered downstream
		return CEnfdProp::EpetRequired;
	}


	ULongPtrArray *pdrgpul = ppimReqd->PdrgpulScanIds(m_mp);
	const ULONG ulScanIds = pdrgpul->Size();

	const ULONG arity = exprhdl.UlNonScalarChildren();
	for (ULONG ul = 0; ul < ulScanIds; ul++)
	{
		ULONG scan_id = *((*pdrgpul)[ul]);

		ULONG ulChildrenWithConsumers = 0;
		for (ULONG ulChildIdx = 0; ulChildIdx < arity; ulChildIdx++)
		{
			if (exprhdl.GetRelationalProperties(ulChildIdx)->Ppartinfo()->FContainsScanId(scan_id))
			{
				ulChildrenWithConsumers++;
			}
		}

		if (1 < ulChildrenWithConsumers)
		{
			// partition consumer exists in more than one child, so enforce it here
			pdrgpul->Release();

			return CEnfdProp::EpetRequired;
		}
	}

	pdrgpul->Release();

	// required part propagation can be enforced here or passed to the children
	return CEnfdProp::EpetOptional;
}
开发者ID:b-xiang,项目名称:gporca,代码行数:73,代码来源:CPhysicalUnionAll.cpp


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