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


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

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


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

示例1: CMaxCard

//---------------------------------------------------------------------------
//	@function:
//		CLogicalAssert::Maxcard
//
//	@doc:
//		Derive max card
//
//---------------------------------------------------------------------------
CMaxCard
CLogicalAssert::Maxcard
	(
	IMemoryPool *, // pmp
	CExpressionHandle &exprhdl
	)
	const
{
	// in case of a false condition or a contradiction, maxcard should be 1
	CExpression *pexprScalar = exprhdl.PexprScalarChild(1);
	GPOS_ASSERT(NULL != pexprScalar);

	if (CUtils::FScalarConstFalse(pexprScalar) ||
		CDrvdPropRelational::Pdprel(exprhdl.Pdp())->Ppc()->FContradiction())
	{
		return CMaxCard(1 /*ull*/);
	}

	// if Assert operator was generated from MaxOneRow operator,
	// then a max cardinality of 1 is expected
	if (NULL != exprhdl.Pgexpr() &&
		CXform::ExfMaxOneRow2Assert == exprhdl.Pgexpr()->ExfidOrigin())
	{
		return CMaxCard(1 /*ull*/);
	}

	// pass on max card of first child
	return exprhdl.Pdprel(0)->Maxcard();
}
开发者ID:HanumathRao,项目名称:gporca,代码行数:37,代码来源:CLogicalAssert.cpp

示例2:

//---------------------------------------------------------------------------
//	@function:
//		CPhysicalComputeScalar::EpetRewindability
//
//	@doc:
//		Return the enforcing type for rewindability property based on this operator
//
//---------------------------------------------------------------------------
CEnfdProp::EPropEnforcingType
CPhysicalComputeScalar::EpetRewindability
	(
	CExpressionHandle &exprhdl,
	const CEnfdRewindability *per
	)
	const
{
	CColRefSet *pcrsUsed = exprhdl.Pdpscalar(1 /*ulChidIndex*/)->PcrsUsed();
	CColRefSet *pcrsCorrelatedApply = exprhdl.Pdprel()->PcrsCorrelatedApply();
	if (!pcrsUsed->FDisjoint(pcrsCorrelatedApply))
	{
		// columns are used from inner children of correlated-apply expressions,
		// this means that a subplan occurs below the Project operator,
		// in this case, rewindability needs to be enforced on operator's output

		return CEnfdProp::EpetRequired;
	}

	CRewindabilitySpec *prs = CDrvdPropPlan::Pdpplan(exprhdl.Pdp())->Prs();
	if (per->FCompatible(prs))
	{
		 // required distribution is already provided
		 return CEnfdProp::EpetUnnecessary;
	}

	// rewindability is enforced on operator's output
	return CEnfdProp::EpetRequired;
}
开发者ID:HanumathRao,项目名称:gporca,代码行数:37,代码来源:CPhysicalComputeScalar.cpp

示例3: CColRefSet

//---------------------------------------------------------------------------
//	@function:
//		CPhysicalJoin::FProvidesReqdCols
//
//	@doc:
//		Helper for checking if required columns are included in output columns
//
//---------------------------------------------------------------------------
BOOL
CPhysicalJoin::FProvidesReqdCols
	(
	CExpressionHandle &exprhdl,
	CColRefSet *pcrsRequired,
	ULONG // ulOptReq
	)
	const
{
	GPOS_ASSERT(NULL != pcrsRequired);
	GPOS_ASSERT(3 == exprhdl.UlArity());

	// union columns from relational children
	CColRefSet *pcrs = GPOS_NEW(m_pmp) CColRefSet(m_pmp);
	ULONG ulArity = exprhdl.UlArity();
	for (ULONG i = 0; i < ulArity - 1; i++)
	{
		CColRefSet *pcrsChild = exprhdl.Pdprel(i)->PcrsOutput();
		pcrs->Union(pcrsChild);
	}

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

	return fProvidesCols;
}
开发者ID:d,项目名称:gporca,代码行数:34,代码来源:CPhysicalJoin.cpp

示例4:

//---------------------------------------------------------------------------
//	@function:
//		CXformInnerApplyWithOuterKey2InnerJoin::Exfp
//
//	@doc:
//		Compute xform promise for a given expression handle;
//
//---------------------------------------------------------------------------
CXform::EXformPromise
CXformInnerApplyWithOuterKey2InnerJoin::Exfp
	(
	CExpressionHandle &exprhdl
	)
	const
{
	// check if outer child has key and inner child has outer references
	if (NULL == exprhdl.Pdprel(0)->Pkc() ||
		0 == exprhdl.Pdprel(1)->PcrsOuter()->CElements())
	{
		return ExfpNone;
	}

	return ExfpHigh;
}
开发者ID:HanumathRao,项目名称:gporca,代码行数:24,代码来源:CXformInnerApplyWithOuterKey2InnerJoin.cpp

示例5:

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

示例6:

//---------------------------------------------------------------------------
//	@function:
//		CLogical::MaxcardDef
//
//	@doc:
//		Default max card for join and apply operators
//
//---------------------------------------------------------------------------
CMaxCard
CLogical::MaxcardDef
	(
	CExpressionHandle &exprhdl
	)
{
	const ULONG ulArity = exprhdl.UlArity();

	CMaxCard maxcard = exprhdl.Pdprel(0)->Maxcard();
	for (ULONG ul = 1; ul < ulArity - 1; ul++)
	{
		if (!exprhdl.FScalarChild(ul))
		{
			maxcard *= exprhdl.Pdprel(ul)->Maxcard();
		}
	}

	return maxcard;
}
开发者ID:HanumathRao,项目名称:gporca,代码行数:27,代码来源:CLogical.cpp

示例7: Maxcard

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

示例8:

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

示例9:

//---------------------------------------------------------------------------
//	@function:
//		CXformJoinAssociativity::Exfp
//
//	@doc:
//		Compute xform promise for a given expression handle
//
//---------------------------------------------------------------------------
CXform::EXformPromise
CXformJoinAssociativity::Exfp
	(
	CExpressionHandle &exprhdl
	)
	const
{
	if 
		(
		GPOPT_MAX_JOIN_DEPTH_FOR_ASSOCIATIVITY < exprhdl.Pdprel()->UlJoinDepth() ||  // disallow xform beyond max join depth
		GPOPT_MAX_JOIN_RIGHT_CHILD_DEPTH_FOR_ASSOCIATIVITY < exprhdl.Pdprel(1)->UlJoinDepth()  // disallow xform if input is not a left deep tree
		)
	{
		// restrict associativity to left-deep trees by prohibiting the
		// transformation when right child's join depth is above threshold
		return CXform::ExfpNone;
	}

	return CXform::ExfpHigh;
}
开发者ID:MoZhonghua,项目名称:gporca,代码行数:28,代码来源:CXformJoinAssociativity.cpp

示例10:

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

	CColRefSet *pcrsOutput = exprhdl.Pdprel()->PcrsOutput();
	return pcrsOutput->FSubset(pcrsRequired);
}
开发者ID:HanumathRao,项目名称:gporca,代码行数:22,代码来源:CPhysicalCTEConsumer.cpp

示例11:

//---------------------------------------------------------------------------
//	@function:
//		CPhysicalJoin::FOuterProvidesReqdCols
//
//	@doc:
//		Helper for checking if the outer input of a binary join operator
//		includes the required columns
//
//---------------------------------------------------------------------------
BOOL
CPhysicalJoin::FOuterProvidesReqdCols
	(
	CExpressionHandle &exprhdl,
	CColRefSet *pcrsRequired
	)
{
	GPOS_ASSERT(NULL != pcrsRequired);
	GPOS_ASSERT(3 == exprhdl.UlArity() && "expected binary join");

	CColRefSet *pcrsOutput = exprhdl.Pdprel(0 /*ulChildIndex*/)->PcrsOutput();

	return pcrsOutput->FSubset(pcrsRequired);
}
开发者ID:d,项目名称:gporca,代码行数:23,代码来源:CPhysicalJoin.cpp

示例12: CMaxCard

//---------------------------------------------------------------------------
//	@function:
//		CLogicalDifferenceAll::Maxcard
//
//	@doc:
//		Derive max card
//
//---------------------------------------------------------------------------
CMaxCard
CLogicalDifferenceAll::Maxcard
	(
	IMemoryPool *, // pmp
	CExpressionHandle &exprhdl
	)
	const
{
	// contradictions produce no rows
	if (CDrvdPropRelational::Pdprel(exprhdl.Pdp())->Ppc()->FContradiction())
	{
		return CMaxCard(0 /*ull*/);
	}

	return exprhdl.Pdprel(0)->Maxcard();
}
开发者ID:d,项目名称:gporca,代码行数:24,代码来源:CLogicalDifferenceAll.cpp

示例13:

//---------------------------------------------------------------------------
//	@function:
//		CXformInnerJoinWithInnerSelect2PartialDynamicIndexGetApply::Exfp
//
//	@doc:
//		Compute xform promise for a given expression handle
//
//---------------------------------------------------------------------------
CXform::EXformPromise
CXformInnerJoinWithInnerSelect2PartialDynamicIndexGetApply::Exfp
	(
	CExpressionHandle &exprhdl
	)
	const
{
	if (CXform::ExfpNone == CXformInnerJoin2IndexApply::Exfp(exprhdl))
	{
		return CXform::ExfpNone;
	}

	if (exprhdl.Pdprel(1 /*ulChildIndex*/)->FHasPartialIndexes())
	{
		return CXform::ExfpHigh;
	}

	return CXform::ExfpNone;
}
开发者ID:HanumathRao,项目名称:gporca,代码行数:27,代码来源:CXformInnerJoinWithInnerSelect2PartialDynamicIndexGetApply.cpp

示例14: CMaxCard

//---------------------------------------------------------------------------
//	@function:
//		CLogicalSelect::Maxcard
//
//	@doc:
//		Derive max card
//
//---------------------------------------------------------------------------
CMaxCard
CLogicalSelect::Maxcard
	(
	IMemoryPool *, // pmp
	CExpressionHandle &exprhdl
	)
	const
{
	// in case of a false condition or a contradiction, maxcard should be zero
	CExpression *pexprScalar = exprhdl.PexprScalarChild(1);
	if ((NULL != pexprScalar && CUtils::FScalarConstFalse(pexprScalar)) ||
		CDrvdPropRelational::Pdprel(exprhdl.Pdp())->Ppc()->FContradiction())
	{
		return CMaxCard(0 /*ull*/);
	}

	// pass on max card of first child
	return exprhdl.Pdprel(0)->Maxcard();
}
开发者ID:d,项目名称:gporca,代码行数:27,代码来源:CLogicalSelect.cpp

示例15:

//---------------------------------------------------------------------------
//	@function:
//		CPhysicalSequence::FProvidesReqdCols
//
//	@doc:
//		Helper for checking if required columns are included in output columns
//
//---------------------------------------------------------------------------
BOOL
CPhysicalSequence::FProvidesReqdCols
	(
	CExpressionHandle &exprhdl,
	CColRefSet *pcrsRequired,
	ULONG // ulOptReq
	)
	const
{
	GPOS_ASSERT(NULL != pcrsRequired);

	// last child must provide required columns
	ULONG ulArity = exprhdl.UlArity();
	GPOS_ASSERT(0 < ulArity);
	
	CColRefSet *pcrsChild = exprhdl.Pdprel(ulArity - 1)->PcrsOutput();

	return pcrsChild->FSubset(pcrsRequired);
}
开发者ID:vraghavan78,项目名称:gporca,代码行数:27,代码来源:CPhysicalSequence.cpp


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