diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index 03a5fbdc6dc..c242eec34d6 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -34,6 +34,7 @@ #include "optimizer/restrictinfo.h" #include "utils/lsyscache.h" #include "utils/selfuncs.h" +#include "parser/parse_expr.h" /* XXX see PartCollMatchesExprColl */ @@ -715,8 +716,8 @@ get_index_paths(PlannerInfo *root, RelOptInfo *rel, List **bitindexpaths) { List *indexpaths; - bool skip_nonnative_saop = false; - bool skip_lower_saop = false; + bool skip_nonnative_saop; + bool skip_lower_saop; ListCell *lc; /* @@ -737,7 +738,7 @@ get_index_paths(PlannerInfo *root, RelOptInfo *rel, * that supports them, then try again including those clauses. This will * produce paths with more selectivity but no ordering. */ - if (skip_lower_saop) + if (skip_lower_saop || enable_or_transformation) { indexpaths = list_concat(indexpaths, build_index_paths(root, rel, @@ -778,7 +779,7 @@ get_index_paths(PlannerInfo *root, RelOptInfo *rel, * natively, generate bitmap scan paths relying on executor-managed * ScalarArrayOpExpr. */ - if (skip_nonnative_saop) + if (skip_nonnative_saop || enable_or_transformation) { indexpaths = build_index_paths(root, rel, index, clauses, @@ -908,7 +912,7 @@ build_index_paths(PlannerInfo *root, RelOptInfo *rel, { if (!index->amsearcharray) { - if (skip_nonnative_saop) + if (skip_nonnative_saop || enable_or_transformation) { /* Ignore because not supported by index */ *skip_nonnative_saop = true; @@ -919,7 +923,7 @@ build_index_paths(PlannerInfo *root, RelOptInfo *rel, } if (indexcol > 0) { - if (skip_lower_saop) + if (skip_lower_saop || enable_or_transformation) { /* Caller doesn't want to lose index ordering */ *skip_lower_saop = true;