Given an operator expression and an index column with an index * Validates whether that operator + column is supported in this index */
| 912 | /* Given an operator expression and an index column with an index |
| 913 | * Validates whether that operator + column is supported in this index */ |
| 914 | static bool |
| 915 | MatchClauseWithIndexForFuncExpr(IndexPath *path, int32_t indexcol, Oid funcId, List *args) |
| 916 | { |
| 917 | Node *operand = (Node *) lsecond(args); |
| 918 | |
| 919 | /* not a const - can't evaluate this here */ |
| 920 | if (!IsA(operand, Const)) |
| 921 | { |
| 922 | return true; |
| 923 | } |
| 924 | |
| 925 | /* if no options - thunk to default cost estimation */ |
| 926 | bytea *options = path->indexinfo->opclassoptions[indexcol]; |
| 927 | if (options == NULL) |
| 928 | { |
| 929 | return true; |
| 930 | } |
| 931 | |
| 932 | BsonIndexStrategy strategy = GetBsonStrategyForFuncId(funcId); |
| 933 | if (strategy == BSON_INDEX_STRATEGY_INVALID) |
| 934 | { |
| 935 | return false; |
| 936 | } |
| 937 | |
| 938 | Datum queryValue = ((Const *) operand)->constvalue; |
| 939 | return ValidateIndexForQualifierValue(options, queryValue, strategy); |
| 940 | } |
| 941 | |
| 942 | |
| 943 | /* |
no test coverage detected