40 #define IndexCollMatchesExprColl(idxcollation, exprcollation) \
41 ((idxcollation) == InvalidOid || (idxcollation) == (exprcollation))
82 List **bitindexpaths);
89 List *indexjoinclauses,
90 int considered_clauses,
91 List **considered_relids);
99 List **considered_relids);
101 List *indexjoinclauses);
104 List **bitindexpaths);
107 bool useful_predicate,
109 bool *skip_nonnative_saop,
110 bool *skip_lower_saop);
112 List *clauses,
List *other_clauses);
114 List *clauses,
List *other_clauses);
139 List **joinorclauses);
188 List **orderby_clauses_p,
189 List **clause_columns_p);
191 int indexcol,
Expr *clause,
Oid pk_opfamily);
251 bitindexpaths = bitjoinpaths = joinorclauses =
NIL;
272 MemSet(&rclauseset, 0,
sizeof(rclauseset));
289 MemSet(&jclauseset, 0,
sizeof(jclauseset));
291 &jclauseset, &joinorclauses);
297 MemSet(&eclauseset, 0,
sizeof(eclauseset));
319 bitindexpaths =
list_concat(bitindexpaths, indexpaths);
327 bitjoinpaths =
list_concat(bitjoinpaths, indexpaths);
336 if (bitindexpaths !=
NIL)
361 if (bitjoinpaths !=
NIL)
363 List *all_path_outers;
366 all_path_outers =
NIL;
367 foreach(lc, bitjoinpaths)
377 foreach(lc, all_path_outers)
389 foreach(lcp, bitjoinpaths)
394 this_path_set =
lappend(this_path_set, path);
401 this_path_set =
list_concat(this_path_set, bitindexpaths);
410 required_outer, loop_count, 0);
437 List **bitindexpaths)
439 int considered_clauses = 0;
464 for (indexcol = 0; indexcol <
index->nkeycolumns; indexcol++)
469 rclauseset, jclauseset, eclauseset,
477 rclauseset, jclauseset, eclauseset,
503 List **bitindexpaths,
504 List *indexjoinclauses,
505 int considered_clauses,
506 List **considered_relids)
511 foreach(lc, indexjoinclauses)
514 Relids clause_relids = iclause->
rinfo->clause_relids;
516 int num_considered_relids;
519 if (
list_member(*considered_relids, clause_relids))
535 num_considered_relids =
list_length(*considered_relids);
536 for (
int pos = 0; pos < num_considered_relids; pos++)
567 if (
list_length(*considered_relids) >= 10 * considered_clauses)
572 rclauseset, jclauseset, eclauseset,
580 rclauseset, jclauseset, eclauseset,
606 List **bitindexpaths,
608 List **considered_relids)
618 MemSet(&clauseset, 0,
sizeof(clauseset));
620 for (indexcol = 0; indexcol <
index->nkeycolumns; indexcol++)
670 *considered_relids =
lappend(*considered_relids, relids);
680 List *indexjoinclauses)
684 foreach(lc, indexjoinclauses)
689 if (rinfo->parent_ec == parent_ec &&
715 List **bitindexpaths)
718 bool skip_nonnative_saop =
false;
719 bool skip_lower_saop =
false;
732 &skip_nonnative_saop,
747 &skip_nonnative_saop,
763 foreach(lc, indexpaths)
767 if (
index->amhasgettuple)
770 if (
index->amhasgetbitmap &&
773 *bitindexpaths =
lappend(*bitindexpaths, ipath);
781 if (skip_nonnative_saop)
789 *bitindexpaths =
list_concat(*bitindexpaths, indexpaths);
837 bool useful_predicate,
839 bool *skip_nonnative_saop,
840 bool *skip_lower_saop)
847 List *orderbyclauses;
848 List *orderbyclausecols;
849 List *index_pathkeys;
850 List *useful_pathkeys;
851 bool found_lower_saop_clause;
852 bool pathkeys_possibly_useful;
853 bool index_is_ordered;
854 bool index_only_scan;
863 if (!
index->amhasgettuple)
867 if (!
index->amhasgetbitmap)
895 found_lower_saop_clause =
false;
897 for (indexcol = 0; indexcol <
index->nkeycolumns; indexcol++)
909 if (!
index->amsearcharray)
911 if (skip_nonnative_saop)
914 *skip_nonnative_saop =
true;
925 *skip_lower_saop =
true;
928 found_lower_saop_clause =
true;
933 index_clauses =
lappend(index_clauses, iclause);
935 rinfo->clause_relids);
946 if (index_clauses ==
NIL && !
index->amoptionalkey)
963 !found_lower_saop_clause &&
965 index_is_ordered = (
index->sortopfamily != NULL);
966 if (index_is_ordered && pathkeys_possibly_useful)
972 orderbyclauses =
NIL;
973 orderbyclausecols =
NIL;
975 else if (
index->amcanorderbyop && pathkeys_possibly_useful)
984 useful_pathkeys =
NIL;
988 useful_pathkeys =
NIL;
989 orderbyclauses =
NIL;
990 orderbyclausecols =
NIL;
1007 if (index_clauses !=
NIL || useful_pathkeys !=
NIL || useful_predicate ||
1020 result =
lappend(result, ipath);
1026 if (
index->amcanparallel &&
1055 if (index_is_ordered && pathkeys_possibly_useful)
1061 if (useful_pathkeys !=
NIL)
1073 result =
lappend(result, ipath);
1076 if (
index->amcanparallel &&
1134 List *clauses,
List *other_clauses)
1145 bool useful_predicate;
1148 if (!
index->amhasgetbitmap)
1163 useful_predicate =
false;
1173 if (all_clauses ==
NIL)
1180 useful_predicate =
true;
1187 MemSet(&clauseset, 0,
sizeof(clauseset));
1194 if (!clauseset.
nonempty && !useful_predicate)
1229 List *clauses,
List *other_clauses)
1241 foreach(lc, clauses)
1257 foreach(
j, ((
BoolExpr *) rinfo->orclause)->args)
1305 pathlist =
lappend(pathlist, bitmapqual);
1312 if (pathlist !=
NIL)
1315 result =
lappend(result, bitmapqual);
1419 pathinfoarray[npaths++] = pathinfo;
1423 for (
i = 0;
i < npaths;
i++)
1425 if (!pathinfoarray[
i]->unclassifiable &&
1440 pathinfoarray[
i] = pathinfo;
1445 pathinfoarray[npaths++] = pathinfo;
1451 return pathinfoarray[0]->
path;
1466 for (
i = 0;
i < npaths;
i++)
1472 pathinfo = pathinfoarray[
i];
1478 for (
j =
i + 1;
j < npaths;
j++)
1482 pathinfo = pathinfoarray[
j];
1486 if (pathinfo->
preds)
1488 bool redundant =
false;
1491 foreach(l, pathinfo->
preds)
1507 if (newcost < costsofar)
1510 costsofar = newcost;
1524 if (
i == 0 || costsofar < bestcost)
1527 bestcost = costsofar;
1561 if (aselec < bselec)
1563 if (aselec > bselec)
1579 bpath.
path.type = T_BitmapHeapPath;
1581 bpath.
path.parent = rel;
1583 bpath.
path.param_info = ipath->param_info;
1595 bpath.
path.param_info,
1644 result->
path = path;
1668 foreach(lc, result->
quals)
1675 foreach(lc, result->
preds)
1758 foreach(lc, *nodelist)
1762 if (
equal(node, oldnode))
1767 *nodelist =
lappend(*nodelist, node);
1782 Bitmapset *index_canreturn_attrs = NULL;
1813 foreach(lc,
index->indrestrictinfo)
1824 for (
i = 0;
i <
index->ncolumns;
i++)
1826 int attno =
index->indexkeys[
i];
1836 index_canreturn_attrs =
1883 if (outer_relids == NULL)
1888 while ((outer_relid =
bms_next_member(outer_relids, outer_relid)) >= 0)
1896 outer_rel = root->simple_rel_array[outer_relid];
1897 if (outer_rel == NULL)
1915 if (result == 0.0 || result > rowcount)
1919 return (result > 0.0) ? result : 1.0;
1955 if (rowcount > nunique)
1976 double rowcount = 1.0;
1987 rel = root->simple_rel_array[relid];
2000 rowcount *= rel->
rows;
2034 List **joinorclauses)
2049 *joinorclauses =
lappend(*joinorclauses, rinfo);
2067 if (!
index->rel->has_eclass_joins)
2070 for (indexcol = 0; indexcol <
index->nkeycolumns; indexcol++)
2077 arg.indexcol = indexcol;
2082 index->rel->lateral_referencers);
2106 foreach(lc, clauses)
2145 if (rinfo->pseudoconstant)
2156 for (indexcol = 0; indexcol <
index->nkeycolumns; indexcol++)
2166 if (iclause->
rinfo == rinfo)
2260 Assert(indexcol < index->nkeycolumns);
2270 opfamily =
index->opfamily[indexcol];
2303 if (!nt->argisrow &&
2307 iclause->
rinfo = rinfo;
2309 iclause->
lossy =
false;
2331 return IsBuiltinBooleanOpfamily(opfamily);
2423 iclause->
rinfo = rinfo;
2425 iclause->
lossy =
false;
2465 expr_op = clause->
opno;
2466 expr_coll = clause->inputcollid;
2468 index_relid =
index->rel->relid;
2469 opfamily =
index->opfamily[indexcol];
2470 idxcollation =
index->indexcollations[indexcol];
2489 iclause->
rinfo = rinfo;
2491 iclause->
lossy =
false;
2528 iclause->
rinfo = rinfo;
2530 iclause->
lossy =
false;
2579 foreach(lc, clause->
args)
2619 req.
type = T_SupportRequestIndexCondition;
2645 foreach(lc, sresult)
2649 indexquals =
lappend(indexquals,
2653 iclause->
rinfo = rinfo;
2692 expr_op = saop->
opno;
2693 expr_coll = saop->inputcollid;
2695 index_relid =
index->rel->relid;
2696 opfamily =
index->opfamily[indexcol];
2697 idxcollation =
index->indexcollations[indexcol];
2711 iclause->
rinfo = rinfo;
2713 iclause->
lossy =
false;
2755 if (
index->relam != BTREE_AM_OID)
2758 index_relid =
index->rel->relid;
2759 opfamily =
index->opfamily[indexcol];
2760 idxcollation =
index->indexcollations[indexcol];
2799 var_on_left =
false;
2867 iclause->
rinfo = rinfo;
2872 var_args = clause->
largs;
2873 non_var_args = clause->
rargs;
2877 var_args = clause->
rargs;
2878 non_var_args = clause->
largs;
2925 for (
i = 0;
i <
index->nkeycolumns;
i++)
2929 index->opfamily[
i]) == op_strategy &&
2935 if (
i >=
index->nkeycolumns)
2949 righttypes =
lappend_oid(righttypes, op_righttype);
2962 if (var_on_left && !iclause->
lossy)
2971 if (!iclause->
lossy)
2993 elog(
ERROR,
"unexpected strategy number %d", op_strategy);
2995 forthree(opfamilies_cell, opfamilies,
2996 lefttypes_cell, lefttypes,
2997 righttypes_cell, righttypes)
3006 elog(
ERROR,
"missing operator %d(%u,%u) in opfamily %u",
3007 op_strategy, lefttype, righttype, opfam);
3013 if (matching_cols > 1)
3018 rc->opnos = new_ops;
3067 List **orderby_clauses_p,
3068 List **clause_columns_p)
3074 *orderby_clauses_p =
NIL;
3075 *clause_columns_p =
NIL;
3078 if (!
index->amcanorderbyop)
3081 foreach(lc1, pathkeys)
3098 if (pathkey->pk_eclass->ec_has_volatile)
3109 foreach(lc2, pathkey->pk_eclass->ec_members)
3126 for (indexcol = 0; indexcol <
index->nkeycolumns; indexcol++)
3136 orderby_clauses =
lappend(orderby_clauses, expr);
3137 clause_columns =
lappend_int(clause_columns, indexcol);
3151 *orderby_clauses_p = orderby_clauses;
3152 *clause_columns_p = clause_columns;
3195 Assert(indexcol < index->nkeycolumns);
3197 opfamily =
index->opfamily[indexcol];
3198 idxcollation =
index->indexcollations[indexcol];
3207 if (!leftop || !rightop)
3209 expr_op = ((
OpExpr *) clause)->opno;
3210 expr_coll = ((
OpExpr *) clause)->inputcollid;
3246 if (sortfamily != pk_opfamily)
3255 memcpy(newclause, clause,
sizeof(
OpExpr));
3258 newclause->
opno = expr_op;
3262 clause = (
Expr *) newclause;
3311 have_partial =
false;
3318 have_partial =
true;
3341 clauselist =
lappend(clauselist, rinfo);
3416 index->indpred,
false))
3442 Assert(indexcol < index->nkeycolumns);
3444 curFamily =
index->opfamily[indexcol];
3445 curCollation =
index->indexcollations[indexcol];
3457 if (
index->relam == BTREE_AM_OID &&
3516 if (restrictinfo->mergeopfamilies ==
NIL)
3526 restrictinfo->outer_is_left =
true;
3531 restrictinfo->outer_is_left =
false;
3537 restrictlist =
lappend(restrictlist, restrictinfo);
3541 if (restrictlist ==
NIL && exprlist ==
NIL)
3554 if (!
ind->unique || !
ind->immediate ||
3562 for (
c = 0;
c <
ind->nkeycolumns;
c++)
3564 bool matched =
false;
3568 foreach(lc, restrictlist)
3589 if (rinfo->outer_is_left)
3604 forboth(lc, exprlist, lc2, oprlist)
3638 if (
c ==
ind->nkeycolumns)
3673 foreach(lc,
index->rel->baserestrictinfo)
3682 if (rinfo->pseudoconstant)
3728 indkey =
index->indexkeys[indexcol];
3734 if (operand &&
IsA(operand,
Var) &&
3735 index->rel->relid == ((
Var *) operand)->varno &&
3736 indkey == ((
Var *) operand)->varattno &&
3737 ((
Var *) operand)->varnullingrels == NULL)
3752 for (
i = 0;
i < indexcol;
i++)
3754 if (
index->indexkeys[
i] == 0)
3756 if (indexpr_item == NULL)
3757 elog(
ERROR,
"wrong number of index expressions");
3758 indexpr_item =
lnext(
index->indexprs, indexpr_item);
3761 if (indexpr_item == NULL)
3762 elog(
ERROR,
"wrong number of index expressions");
3771 if (
equal(indexkey, operand))
void create_partial_bitmap_paths(PlannerInfo *root, RelOptInfo *rel, Path *bitmapqual)
bool bms_equal(const Bitmapset *a, const Bitmapset *b)
BMS_Comparison bms_subset_compare(const Bitmapset *a, const Bitmapset *b)
int bms_next_member(const Bitmapset *a, int prevbit)
bool bms_is_subset(const Bitmapset *a, const Bitmapset *b)
void bms_free(Bitmapset *a)
bool bms_is_member(int x, const Bitmapset *a)
Bitmapset * bms_add_member(Bitmapset *a, int x)
Bitmapset * bms_union(const Bitmapset *a, const Bitmapset *b)
Bitmapset * bms_difference(const Bitmapset *a, const Bitmapset *b)
Bitmapset * bms_add_members(Bitmapset *a, const Bitmapset *b)
Bitmapset * bms_del_members(Bitmapset *a, const Bitmapset *b)
Bitmapset * bms_del_member(Bitmapset *a, int x)
bool bms_overlap(const Bitmapset *a, const Bitmapset *b)
Bitmapset * bms_copy(const Bitmapset *a)
#define MemSet(start, val, len)
#define OidIsValid(objectId)
bool contain_mutable_functions(Node *clause)
bool contain_volatile_functions(Node *clause)
void cost_bitmap_tree_node(Path *path, Cost *cost, Selectivity *selec)
void cost_bitmap_heap_scan(Path *path, PlannerInfo *root, RelOptInfo *baserel, ParamPathInfo *param_info, Path *bitmapqual, double loop_count)
bool enable_indexonlyscan
elog(ERROR, "%s: %s", p2, msg)
bool equal(const void *a, const void *b)
List * generate_implied_equalities_for_column(PlannerInfo *root, RelOptInfo *rel, ec_matches_callback_type callback, void *callback_arg, Relids prohibited_rels)
List * generate_join_implied_equalities(PlannerInfo *root, Relids join_relids, Relids outer_relids, RelOptInfo *inner_rel, Index ojrelid)
#define OidFunctionCall1(functionId, arg1)
static bool IsBooleanOpfamily(Oid opfamily)
static Path * choose_bitmap_and(PlannerInfo *root, RelOptInfo *rel, List *paths)
static Cost bitmap_and_cost_est(PlannerInfo *root, RelOptInfo *rel, List *paths)
static void find_indexpath_quals(Path *bitmapqual, List **quals, List **preds)
static void get_join_index_paths(PlannerInfo *root, RelOptInfo *rel, IndexOptInfo *index, IndexClauseSet *rclauseset, IndexClauseSet *jclauseset, IndexClauseSet *eclauseset, List **bitindexpaths, Relids relids, List **considered_relids)
static List * build_index_paths(PlannerInfo *root, RelOptInfo *rel, IndexOptInfo *index, IndexClauseSet *clauses, bool useful_predicate, ScanTypeControl scantype, bool *skip_nonnative_saop, bool *skip_lower_saop)
static void match_clause_to_index(PlannerInfo *root, RestrictInfo *rinfo, IndexOptInfo *index, IndexClauseSet *clauseset)
bool is_pseudo_constant_for_index(PlannerInfo *root, Node *expr, IndexOptInfo *index)
static bool eclass_already_used(EquivalenceClass *parent_ec, Relids oldrelids, List *indexjoinclauses)
static void match_join_clauses_to_index(PlannerInfo *root, RelOptInfo *rel, IndexOptInfo *index, IndexClauseSet *clauseset, List **joinorclauses)
static IndexClause * match_saopclause_to_indexcol(PlannerInfo *root, RestrictInfo *rinfo, int indexcol, IndexOptInfo *index)
static bool check_index_only(RelOptInfo *rel, IndexOptInfo *index)
static void match_eclass_clauses_to_index(PlannerInfo *root, IndexOptInfo *index, IndexClauseSet *clauseset)
static PathClauseUsage * classify_index_clause_usage(Path *path, List **clauselist)
static void get_index_paths(PlannerInfo *root, RelOptInfo *rel, IndexOptInfo *index, IndexClauseSet *clauses, List **bitindexpaths)
void check_index_predicates(PlannerInfo *root, RelOptInfo *rel)
static void match_pathkeys_to_index(IndexOptInfo *index, List *pathkeys, List **orderby_clauses_p, List **clause_columns_p)
static int find_list_position(Node *node, List **nodelist)
static void match_clauses_to_index(PlannerInfo *root, List *clauses, IndexOptInfo *index, IndexClauseSet *clauseset)
static double get_loop_count(PlannerInfo *root, Index cur_relid, Relids outer_relids)
bool relation_has_unique_index_for(PlannerInfo *root, RelOptInfo *rel, List *restrictlist, List *exprlist, List *oprlist)
static void consider_index_join_outer_rels(PlannerInfo *root, RelOptInfo *rel, IndexOptInfo *index, IndexClauseSet *rclauseset, IndexClauseSet *jclauseset, IndexClauseSet *eclauseset, List **bitindexpaths, List *indexjoinclauses, int considered_clauses, List **considered_relids)
void create_index_paths(PlannerInfo *root, RelOptInfo *rel)
static double adjust_rowcount_for_semijoins(PlannerInfo *root, Index cur_relid, Index outer_relid, double rowcount)
static IndexClause * match_clause_to_indexcol(PlannerInfo *root, RestrictInfo *rinfo, int indexcol, IndexOptInfo *index)
static bool ec_member_matches_indexcol(PlannerInfo *root, RelOptInfo *rel, EquivalenceClass *ec, EquivalenceMember *em, void *arg)
static IndexClause * get_index_clause_from_support(PlannerInfo *root, RestrictInfo *rinfo, Oid funcid, int indexarg, int indexcol, IndexOptInfo *index)
#define IndexCollMatchesExprColl(idxcollation, exprcollation)
static IndexClause * match_opclause_to_indexcol(PlannerInfo *root, RestrictInfo *rinfo, int indexcol, IndexOptInfo *index)
static Cost bitmap_scan_cost_est(PlannerInfo *root, RelOptInfo *rel, Path *ipath)
bool match_index_to_operand(Node *operand, int indexcol, IndexOptInfo *index)
static IndexClause * match_boolean_index_clause(PlannerInfo *root, RestrictInfo *rinfo, int indexcol, IndexOptInfo *index)
static void consider_index_join_clauses(PlannerInfo *root, RelOptInfo *rel, IndexOptInfo *index, IndexClauseSet *rclauseset, IndexClauseSet *jclauseset, IndexClauseSet *eclauseset, List **bitindexpaths)
static IndexClause * expand_indexqual_rowcompare(PlannerInfo *root, RestrictInfo *rinfo, int indexcol, IndexOptInfo *index, Oid expr_op, bool var_on_left)
static void match_restriction_clauses_to_index(PlannerInfo *root, IndexOptInfo *index, IndexClauseSet *clauseset)
static IndexClause * match_rowcompare_to_indexcol(PlannerInfo *root, RestrictInfo *rinfo, int indexcol, IndexOptInfo *index)
static List * build_paths_for_OR(PlannerInfo *root, RelOptInfo *rel, List *clauses, List *other_clauses)
bool indexcol_is_bool_constant_for_query(PlannerInfo *root, IndexOptInfo *index, int indexcol)
static IndexClause * match_funcclause_to_indexcol(PlannerInfo *root, RestrictInfo *rinfo, int indexcol, IndexOptInfo *index)
static int path_usage_comparator(const void *a, const void *b)
static double approximate_joinrel_size(PlannerInfo *root, Relids relids)
static Expr * match_clause_to_ordering_op(IndexOptInfo *index, int indexcol, Expr *clause, Oid pk_opfamily)
static List * generate_bitmap_or_paths(PlannerInfo *root, RelOptInfo *rel, List *clauses, List *other_clauses)
if(TABLE==NULL||TABLE_index==NULL)
Assert(fmt[strlen(fmt) - 1] !='\n')
List * list_truncate(List *list, int new_size)
List * lappend(List *list, void *datum)
List * list_copy_head(const List *oldlist, int len)
List * lappend_int(List *list, int datum)
List * lappend_oid(List *list, Oid datum)
List * list_copy(const List *oldlist)
List * list_append_unique(List *list, void *datum)
void list_free(List *list)
bool list_member_oid(const List *list, Oid datum)
List * list_concat(List *list1, const List *list2)
bool list_member(const List *list, const void *datum)
List * list_concat_copy(const List *list1, const List *list2)
void get_op_opfamily_properties(Oid opno, Oid opfamily, bool ordering_op, int *strategy, Oid *lefttype, Oid *righttype)
Oid get_op_opfamily_sortfamily(Oid opno, Oid opfamily)
RegProcedure get_func_support(Oid funcid)
int get_op_opfamily_strategy(Oid opno, Oid opfamily)
Oid get_opfamily_member(Oid opfamily, Oid lefttype, Oid righttype, int16 strategy)
bool op_in_opfamily(Oid opno, Oid opfamily)
Oid get_commutator(Oid opno)
Expr * make_opclause(Oid opno, Oid opresulttype, bool opretset, Expr *leftop, Expr *rightop, Oid opcollid, Oid inputcollid)
Node * makeBoolConst(bool value, bool isnull)
void pfree(void *pointer)
void set_opfuncid(OpExpr *opexpr)
static bool is_andclause(const void *clause)
static Expr * get_notclausearg(const void *notclause)
static bool is_opclause(const void *clause)
static Node * get_rightop(const void *clause)
static bool is_notclause(const void *clause)
static Node * get_leftop(const void *clause)
#define IsA(nodeptr, _type_)
#define castNode(_type_, nodeptr)
bool has_useful_pathkeys(PlannerInfo *root, RelOptInfo *rel)
List * truncate_useless_pathkeys(PlannerInfo *root, RelOptInfo *rel, List *pathkeys)
List * build_index_pathkeys(PlannerInfo *root, IndexOptInfo *index, ScanDirection scandir)
IndexPath * create_index_path(PlannerInfo *root, IndexOptInfo *index, List *indexclauses, List *indexorderbys, List *indexorderbycols, List *pathkeys, ScanDirection indexscandir, bool indexonly, Relids required_outer, double loop_count, bool partial_path)
void add_partial_path(RelOptInfo *parent_rel, Path *new_path)
BitmapOrPath * create_bitmap_or_path(PlannerInfo *root, RelOptInfo *rel, List *bitmapquals)
void add_path(RelOptInfo *parent_rel, Path *new_path)
BitmapAndPath * create_bitmap_and_path(PlannerInfo *root, RelOptInfo *rel, List *bitmapquals)
BitmapHeapPath * create_bitmap_heap_path(PlannerInfo *root, RelOptInfo *rel, Path *bitmapqual, Relids required_outer, double loop_count, int parallel_degree)
#define IS_SIMPLE_REL(rel)
#define PATH_REQ_OUTER(path)
@ RELOPT_OTHER_MEMBER_REL
#define lfirst_node(type, lc)
static int list_length(const List *l)
#define forboth(cell1, list1, cell2, list2)
static Oid list_nth_oid(const List *list, int n)
#define list_make1_oid(x1)
#define forthree(cell1, list1, cell2, list2, cell3, list3)
static ListCell * list_head(const List *l)
static void * list_nth(const List *list, int n)
static ListCell * lnext(const List *l, const ListCell *c)
#define list_make1_int(x1)
#define list_make2(x1, x2)
#define qsort(a, b, c, d)
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)
bool predicate_implied_by(List *predicate_list, List *clause_list, bool weak)
PlanRowMark * get_plan_rowmark(List *rowmarks, Index rtindex)
Relids find_childrel_parents(PlannerInfo *root, RelOptInfo *rel)
bool restriction_is_or_clause(RestrictInfo *restrictinfo)
RestrictInfo * commute_restrictinfo(RestrictInfo *rinfo, Oid comm_op)
bool restriction_is_securely_promotable(RestrictInfo *restrictinfo, RelOptInfo *rel)
bool join_clause_is_movable_to(RestrictInfo *rinfo, RelOptInfo *baserel)
#define make_simple_restrictinfo(root, clause)
double estimate_num_groups(PlannerInfo *root, List *groupExprs, double input_rows, List **pgset, EstimationInfo *estinfo)
#define BTGreaterStrategyNumber
#define BTLessStrategyNumber
#define BTLessEqualStrategyNumber
#define BTGreaterEqualStrategyNumber
BoolTestType booltesttype
List * indexclauses[INDEX_MAX_KEYS]
struct RestrictInfo * rinfo
Selectivity indexselectivity
int simple_rel_array_size
struct PathTarget * reltarget
struct IndexOptInfo * index
struct PlannerInfo * root
#define FirstLowInvalidHeapAttributeNumber
#define FirstNormalObjectId
bool contain_var_clause(Node *node)
Relids pull_varnos(PlannerInfo *root, Node *node)
void pull_varattnos(Node *node, Index varno, Bitmapset **varattnos)