提交 83a2f870 编写于 作者: E Ekta Khanna and Jesse Zhang 提交者: Dhanashree Kashid

Only list complete logical indices for a partitioned table [#143522031]

With cd2cfa7d (disabling heterogeneous index scans) , now we can make
stronger assumption about the usefulness of partial logical indices and
return only complete logical indices for a partitioned table.
上级 3aa7de6a
......@@ -3042,4 +3042,17 @@ gpdb::FMDCacheNeedsReset
return true;
}
bool
gpdb::FPartialLogicalIndex
(
const LogicalIndexInfo *logicalIndexInfo
)
{
// A logical index is complete when it's on all leaf partitions
// A partial logical index will have part constraints or default levels
// set
// c.f. BuildLogicalIndexInfo in cdbpartindex.c
return logicalIndexInfo->partCons || logicalIndexInfo->defaultLevels;
}
// EOF
......@@ -343,7 +343,10 @@ CTranslatorRelcacheToDXL::PlIndexOidsPartTable
for (ULONG ul = 0; ul < ulIndexes; ul++)
{
LogicalIndexInfo *pidxinfo = (plgidx->logicalIndexInfo)[ul];
plOids = gpdb::PlAppendOid(plOids, pidxinfo->logicalIndexOid);
if (!gpdb::FPartialLogicalIndex(pidxinfo))
{
plOids = gpdb::PlAppendOid(plOids, pidxinfo->logicalIndexOid);
}
}
gpdb::GPDBFree(plgidx);
......@@ -1224,7 +1227,7 @@ CTranslatorRelcacheToDXL::PmdindexPartTable
}
}
BOOL fPartial = (NULL != pnodePartCnstr || NIL != plDefaultLevels);
BOOL fPartial = gpdb::FPartialLogicalIndex(pidxinfo);
if (NULL == pnodePartCnstr)
{
......
......@@ -516,6 +516,10 @@ namespace gpdb {
// close the given relation
void CloseRelation(Relation rel);
// A logical index is partial if it's not present on all leaf partitions
// c.f. BuildLogicalIndexInfo in cdbpartindex.c
bool FPartialLogicalIndex(const LogicalIndexInfo* logicalIndexInfo);
// return the logical indexes for a partitioned table
LogicalIndexes *Plgidx(Oid oid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册