Update indxpath.cpp

This commit is contained in:
LuoGe 2023-08-26 16:30:09 +08:00
parent 5563337f8a
commit 9671f7748e
1 changed files with 31 additions and 0 deletions

View File

@ -743,6 +743,16 @@ static void get_index_paths(
}
}
/*
* function name: index_relation_has_bucket
* description: This function checks if an index relation has a bucket.
* arguments:
* - `index`: The IndexOptInfo structure representing the index.
* return value: A boolean indicating whether the index relation has a bucket (true) or not (false).
* note: This function opens the underlying heap relation of the index to check for the presence of a bucket.
* date: 2023/8/16
* contact tel: 18720816902
*/
static inline bool index_relation_has_bucket(IndexOptInfo* index)
{
Assert(index != NULL);
@ -753,6 +763,16 @@ static inline bool index_relation_has_bucket(IndexOptInfo* index)
return hasBucket;
}
/*
* function name: IsEqRestrict
* description: This function checks if a RestrictInfo represents an equality restriction.
* arguments:
* - `rinfo`: The RestrictInfo structure representing the restriction.
* return value: A boolean indicating whether the restriction is an equality restriction (true) or not (false).
* note: The function checks if the given clause is an equality operator clause and if the operator's result type is EQSELRETURNOID.
* date: 2023/8/16
* contact tel: 18720816902
*/
inline bool IsEqRestrict(const RestrictInfo* rinfo)
{
Expr* clause = rinfo->clause;
@ -814,6 +834,17 @@ void MarkUniqueIndexFirstRule(const RelOptInfo* rel, const IndexOptInfo* index,
}
}
/*
* function name: PathkeysIsUnusefulForPartition
* description: This function checks if the path keys of an index are unuseful for partitioning purposes.
* arguments:
* - `index`: The IndexOptInfo structure representing the index.
* return value: A boolean indicating whether the path keys are unuseful for partitioning (true) or not (false).
* note: The function considers various conditions, including if the index is a partitioned index, if it's global or hypothetical,
* and the type of partitioning being used.
* date: 2023/8/16
* contact tel: 18720816902
*/
static bool PathkeysIsUnusefulForPartition(const IndexOptInfo* index)
{
if (!index->ispartitionedindex) {