Created
January 1, 2020 18:14
-
-
Save rueian/63508e145c7eabb652812aa960291823 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| else if (IsA(rawreq, SupportRequestIndexCondition)) | |
| { | |
| /* Try to convert operator/function call to index conditions */ | |
| SupportRequestIndexCondition *req = (SupportRequestIndexCondition *) rawreq; | |
| /* | |
| * Currently we have no "reverse" match operators with the pattern on | |
| * the left, so we only need consider cases with the indexkey on the | |
| * left. | |
| */ | |
| if (req->indexarg != 0) | |
| return NULL; | |
| if (is_opclause(req->node)) | |
| { | |
| OpExpr *clause = (OpExpr *) req->node; | |
| Assert(list_length(clause->args) == 2); | |
| ret = (Node *) | |
| match_pattern_prefix((Node *) linitial(clause->args), | |
| (Node *) lsecond(clause->args), | |
| ptype, | |
| clause->inputcollid, | |
| req->opfamily, | |
| req->indexcollation); | |
| } | |
| else if (is_funcclause(req->node)) /* be paranoid */ | |
| { | |
| FuncExpr *clause = (FuncExpr *) req->node; | |
| Assert(list_length(clause->args) == 2); | |
| ret = (Node *) | |
| match_pattern_prefix((Node *) linitial(clause->args), | |
| (Node *) lsecond(clause->args), | |
| ptype, | |
| clause->inputcollid, | |
| req->opfamily, | |
| req->indexcollation); | |
| } | |
| } | |
| return ret; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment