greenplumn CScalarBitmapIndexProbe 源码

  • 2022-08-18
  • 浏览 (336)

greenplumn CScalarBitmapIndexProbe 代码

文件路径:/src/backend/gporca/libgpopt/src/operators/CScalarBitmapIndexProbe.cpp

//---------------------------------------------------------------------------
//	Greenplum Database
//	Copyright (C) 2014 VMware, Inc. or its affiliates.
//
//	@filename:
//		CScalarBitmapIndexProbe.cpp
//
//	@doc:
//		Bitmap index probe scalar operator
//
//	@owner:
//
//
//	@test:
//
//---------------------------------------------------------------------------

#include "gpopt/operators/CScalarBitmapIndexProbe.h"

#include "gpopt/base/CColRef.h"
#include "gpopt/base/COptCtxt.h"
#include "gpopt/metadata/CIndexDescriptor.h"
#include "gpopt/metadata/CTableDescriptor.h"
#include "gpopt/operators/CExpressionHandle.h"
#include "gpopt/xforms/CXform.h"
#include "naucrates/statistics/CStatisticsUtils.h"

using namespace gpopt;

//---------------------------------------------------------------------------
//	@function:
//		CScalarBitmapIndexProbe::CScalarBitmapIndexProbe
//
//	@doc:
//		Ctor
//		Takes ownership of the index descriptor and the bitmap type id.
//
//---------------------------------------------------------------------------
CScalarBitmapIndexProbe::CScalarBitmapIndexProbe(CMemoryPool *mp,
												 CIndexDescriptor *pindexdesc,
												 IMDId *pmdidBitmapType)
	: CScalar(mp), m_pindexdesc(pindexdesc), m_pmdidBitmapType(pmdidBitmapType)
{
	GPOS_ASSERT(nullptr != mp);
	GPOS_ASSERT(nullptr != pindexdesc);
	GPOS_ASSERT(nullptr != pmdidBitmapType);
}

//---------------------------------------------------------------------------
//	@function:
//		CScalarBitmapIndexProbe::~CScalarBitmapIndexProbe
//
//	@doc:
//		Dtor
//
//---------------------------------------------------------------------------
CScalarBitmapIndexProbe::~CScalarBitmapIndexProbe()
{
	m_pindexdesc->Release();
	m_pmdidBitmapType->Release();
}

//---------------------------------------------------------------------------
//	@function:
//		CScalarBitmapIndexProbe::HashValue
//
//	@doc:
//		Operator specific hash function
//
//---------------------------------------------------------------------------
ULONG
CScalarBitmapIndexProbe::HashValue() const
{
	return gpos::CombineHashes(COperator::HashValue(),
							   m_pindexdesc->MDId()->HashValue());
}


//---------------------------------------------------------------------------
//	@function:
//		CScalarBitmapIndexProbe::Matches
//
//	@doc:
//		Match this operator with the given one.
//
//---------------------------------------------------------------------------
BOOL
CScalarBitmapIndexProbe::Matches(COperator *pop) const
{
	if (pop->Eopid() != Eopid())
	{
		return false;
	}
	CScalarBitmapIndexProbe *popIndexProbe = PopConvert(pop);

	return m_pindexdesc->MDId()->Equals(popIndexProbe->Pindexdesc()->MDId());
}

//---------------------------------------------------------------------------
//	@function:
//		CScalarBitmapIndexProbe::OsPrint
//
//	@doc:
//		Debug print of this operator
//
//---------------------------------------------------------------------------
IOstream &
CScalarBitmapIndexProbe::OsPrint(IOstream &os) const
{
	os << SzId() << " ";
	// index name
	os << "  Bitmap Index Name: (";
	m_pindexdesc->Name().OsPrint(os);
	os << ")";

	return os;
}

// EOF

相关信息

greenplumn 源码目录

相关文章

greenplumn CExpression 源码

greenplumn CExpressionFactorizer 源码

greenplumn CExpressionHandle 源码

greenplumn CExpressionPreprocessor 源码

greenplumn CExpressionUtils 源码

greenplumn CHashedDistributions 源码

greenplumn CLogical 源码

greenplumn CLogicalApply 源码

greenplumn CLogicalAssert 源码

greenplumn CLogicalBitmapTableGet 源码

0  赞