PostgreSQL Source Code  git master
restrictinfo.c
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * restrictinfo.c
4  * RestrictInfo node manipulation routines.
5  *
6  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  *
10  * IDENTIFICATION
11  * src/backend/optimizer/util/restrictinfo.c
12  *
13  *-------------------------------------------------------------------------
14  */
15 #include "postgres.h"
16 
17 #include "nodes/makefuncs.h"
18 #include "nodes/nodeFuncs.h"
19 #include "optimizer/clauses.h"
20 #include "optimizer/optimizer.h"
21 #include "optimizer/restrictinfo.h"
22 
23 
25  Expr *clause,
26  Expr *orclause,
27  bool is_pushed_down,
28  bool outerjoin_delayed,
29  bool pseudoconstant,
30  Index security_level,
31  Relids required_relids,
32  Relids outer_relids,
33  Relids nullable_relids);
35  Expr *clause,
36  bool is_pushed_down,
37  bool outerjoin_delayed,
38  bool pseudoconstant,
39  Index security_level,
40  Relids required_relids,
41  Relids outer_relids,
42  Relids nullable_relids);
43 
44 
45 /*
46  * make_restrictinfo
47  *
48  * Build a RestrictInfo node containing the given subexpression.
49  *
50  * The is_pushed_down, outerjoin_delayed, and pseudoconstant flags for the
51  * RestrictInfo must be supplied by the caller, as well as the correct values
52  * for security_level, outer_relids, and nullable_relids.
53  * required_relids can be NULL, in which case it defaults to the actual clause
54  * contents (i.e., clause_relids).
55  *
56  * We initialize fields that depend only on the given subexpression, leaving
57  * others that depend on context (or may never be needed at all) to be filled
58  * later.
59  */
62  Expr *clause,
63  bool is_pushed_down,
64  bool outerjoin_delayed,
65  bool pseudoconstant,
66  Index security_level,
67  Relids required_relids,
68  Relids outer_relids,
69  Relids nullable_relids)
70 {
71  /*
72  * If it's an OR clause, build a modified copy with RestrictInfos inserted
73  * above each subclause of the top-level AND/OR structure.
74  */
75  if (is_orclause(clause))
76  return (RestrictInfo *) make_sub_restrictinfos(root,
77  clause,
78  is_pushed_down,
79  outerjoin_delayed,
80  pseudoconstant,
81  security_level,
82  required_relids,
83  outer_relids,
84  nullable_relids);
85 
86  /* Shouldn't be an AND clause, else AND/OR flattening messed up */
87  Assert(!is_andclause(clause));
88 
89  return make_restrictinfo_internal(root,
90  clause,
91  NULL,
92  is_pushed_down,
93  outerjoin_delayed,
94  pseudoconstant,
95  security_level,
96  required_relids,
97  outer_relids,
98  nullable_relids);
99 }
100 
101 /*
102  * make_restrictinfo_internal
103  *
104  * Common code for the main entry points and the recursive cases.
105  */
106 static RestrictInfo *
108  Expr *clause,
109  Expr *orclause,
110  bool is_pushed_down,
111  bool outerjoin_delayed,
112  bool pseudoconstant,
113  Index security_level,
114  Relids required_relids,
115  Relids outer_relids,
116  Relids nullable_relids)
117 {
118  RestrictInfo *restrictinfo = makeNode(RestrictInfo);
119 
120  restrictinfo->clause = clause;
121  restrictinfo->orclause = orclause;
122  restrictinfo->is_pushed_down = is_pushed_down;
123  restrictinfo->outerjoin_delayed = outerjoin_delayed;
124  restrictinfo->pseudoconstant = pseudoconstant;
125  restrictinfo->can_join = false; /* may get set below */
126  restrictinfo->security_level = security_level;
127  restrictinfo->outer_relids = outer_relids;
128  restrictinfo->nullable_relids = nullable_relids;
129 
130  /*
131  * If it's potentially delayable by lower-level security quals, figure out
132  * whether it's leakproof. We can skip testing this for level-zero quals,
133  * since they would never get delayed on security grounds anyway.
134  */
135  if (security_level > 0)
136  restrictinfo->leakproof = !contain_leaked_vars((Node *) clause);
137  else
138  restrictinfo->leakproof = false; /* really, "don't know" */
139 
140  /*
141  * Mark volatility as unknown. The contain_volatile_functions function
142  * will determine if there are any volatile functions when called for the
143  * first time with this RestrictInfo.
144  */
145  restrictinfo->has_volatile = VOLATILITY_UNKNOWN;
146 
147  /*
148  * If it's a binary opclause, set up left/right relids info. In any case
149  * set up the total clause relids info.
150  */
151  if (is_opclause(clause) && list_length(((OpExpr *) clause)->args) == 2)
152  {
153  restrictinfo->left_relids = pull_varnos(root, get_leftop(clause));
154  restrictinfo->right_relids = pull_varnos(root, get_rightop(clause));
155 
156  restrictinfo->clause_relids = bms_union(restrictinfo->left_relids,
157  restrictinfo->right_relids);
158 
159  /*
160  * Does it look like a normal join clause, i.e., a binary operator
161  * relating expressions that come from distinct relations? If so we
162  * might be able to use it in a join algorithm. Note that this is a
163  * purely syntactic test that is made regardless of context.
164  */
165  if (!bms_is_empty(restrictinfo->left_relids) &&
166  !bms_is_empty(restrictinfo->right_relids) &&
167  !bms_overlap(restrictinfo->left_relids,
168  restrictinfo->right_relids))
169  {
170  restrictinfo->can_join = true;
171  /* pseudoconstant should certainly not be true */
172  Assert(!restrictinfo->pseudoconstant);
173  }
174  }
175  else
176  {
177  /* Not a binary opclause, so mark left/right relid sets as empty */
178  restrictinfo->left_relids = NULL;
179  restrictinfo->right_relids = NULL;
180  /* and get the total relid set the hard way */
181  restrictinfo->clause_relids = pull_varnos(root, (Node *) clause);
182  }
183 
184  /* required_relids defaults to clause_relids */
185  if (required_relids != NULL)
186  restrictinfo->required_relids = required_relids;
187  else
188  restrictinfo->required_relids = restrictinfo->clause_relids;
189 
190  /*
191  * Fill in all the cacheable fields with "not yet set" markers. None of
192  * these will be computed until/unless needed. Note in particular that we
193  * don't mark a binary opclause as mergejoinable or hashjoinable here;
194  * that happens only if it appears in the right context (top level of a
195  * joinclause list).
196  */
197  restrictinfo->parent_ec = NULL;
198 
199  restrictinfo->eval_cost.startup = -1;
200  restrictinfo->norm_selec = -1;
201  restrictinfo->outer_selec = -1;
202 
203  restrictinfo->mergeopfamilies = NIL;
204 
205  restrictinfo->left_ec = NULL;
206  restrictinfo->right_ec = NULL;
207  restrictinfo->left_em = NULL;
208  restrictinfo->right_em = NULL;
209  restrictinfo->scansel_cache = NIL;
210 
211  restrictinfo->outer_is_left = false;
212 
213  restrictinfo->hashjoinoperator = InvalidOid;
214 
215  restrictinfo->left_bucketsize = -1;
216  restrictinfo->right_bucketsize = -1;
217  restrictinfo->left_mcvfreq = -1;
218  restrictinfo->right_mcvfreq = -1;
219 
220  restrictinfo->hasheqoperator = InvalidOid;
221 
222  return restrictinfo;
223 }
224 
225 /*
226  * Recursively insert sub-RestrictInfo nodes into a boolean expression.
227  *
228  * We put RestrictInfos above simple (non-AND/OR) clauses and above
229  * sub-OR clauses, but not above sub-AND clauses, because there's no need.
230  * This may seem odd but it is closely related to the fact that we use
231  * implicit-AND lists at top level of RestrictInfo lists. Only ORs and
232  * simple clauses are valid RestrictInfos.
233  *
234  * The same is_pushed_down, outerjoin_delayed, and pseudoconstant flag
235  * values can be applied to all RestrictInfo nodes in the result. Likewise
236  * for security_level, outer_relids, and nullable_relids.
237  *
238  * The given required_relids are attached to our top-level output,
239  * but any OR-clause constituents are allowed to default to just the
240  * contained rels.
241  */
242 static Expr *
244  Expr *clause,
245  bool is_pushed_down,
246  bool outerjoin_delayed,
247  bool pseudoconstant,
248  Index security_level,
249  Relids required_relids,
250  Relids outer_relids,
251  Relids nullable_relids)
252 {
253  if (is_orclause(clause))
254  {
255  List *orlist = NIL;
256  ListCell *temp;
257 
258  foreach(temp, ((BoolExpr *) clause)->args)
259  orlist = lappend(orlist,
261  lfirst(temp),
262  is_pushed_down,
263  outerjoin_delayed,
264  pseudoconstant,
265  security_level,
266  NULL,
267  outer_relids,
268  nullable_relids));
269  return (Expr *) make_restrictinfo_internal(root,
270  clause,
271  make_orclause(orlist),
272  is_pushed_down,
273  outerjoin_delayed,
274  pseudoconstant,
275  security_level,
276  required_relids,
277  outer_relids,
278  nullable_relids);
279  }
280  else if (is_andclause(clause))
281  {
282  List *andlist = NIL;
283  ListCell *temp;
284 
285  foreach(temp, ((BoolExpr *) clause)->args)
286  andlist = lappend(andlist,
288  lfirst(temp),
289  is_pushed_down,
290  outerjoin_delayed,
291  pseudoconstant,
292  security_level,
293  required_relids,
294  outer_relids,
295  nullable_relids));
296  return make_andclause(andlist);
297  }
298  else
299  return (Expr *) make_restrictinfo_internal(root,
300  clause,
301  NULL,
302  is_pushed_down,
303  outerjoin_delayed,
304  pseudoconstant,
305  security_level,
306  required_relids,
307  outer_relids,
308  nullable_relids);
309 }
310 
311 /*
312  * commute_restrictinfo
313  *
314  * Given a RestrictInfo containing a binary opclause, produce a RestrictInfo
315  * representing the commutation of that clause. The caller must pass the
316  * OID of the commutator operator (which it's presumably looked up, else
317  * it would not know this is valid).
318  *
319  * Beware that the result shares sub-structure with the given RestrictInfo.
320  * That's okay for the intended usage with derived index quals, but might
321  * be hazardous if the source is subject to change. Also notice that we
322  * assume without checking that the commutator op is a member of the same
323  * btree and hash opclasses as the original op.
324  */
325 RestrictInfo *
327 {
328  RestrictInfo *result;
329  OpExpr *newclause;
330  OpExpr *clause = castNode(OpExpr, rinfo->clause);
331 
332  Assert(list_length(clause->args) == 2);
333 
334  /* flat-copy all the fields of clause ... */
335  newclause = makeNode(OpExpr);
336  memcpy(newclause, clause, sizeof(OpExpr));
337 
338  /* ... and adjust those we need to change to commute it */
339  newclause->opno = comm_op;
340  newclause->opfuncid = InvalidOid;
341  newclause->args = list_make2(lsecond(clause->args),
342  linitial(clause->args));
343 
344  /* likewise, flat-copy all the fields of rinfo ... */
345  result = makeNode(RestrictInfo);
346  memcpy(result, rinfo, sizeof(RestrictInfo));
347 
348  /*
349  * ... and adjust those we need to change. Note in particular that we can
350  * preserve any cached selectivity or cost estimates, since those ought to
351  * be the same for the new clause. Likewise we can keep the source's
352  * parent_ec.
353  */
354  result->clause = (Expr *) newclause;
355  result->left_relids = rinfo->right_relids;
356  result->right_relids = rinfo->left_relids;
357  Assert(result->orclause == NULL);
358  result->left_ec = rinfo->right_ec;
359  result->right_ec = rinfo->left_ec;
360  result->left_em = rinfo->right_em;
361  result->right_em = rinfo->left_em;
362  result->scansel_cache = NIL; /* not worth updating this */
363  if (rinfo->hashjoinoperator == clause->opno)
364  result->hashjoinoperator = comm_op;
365  else
366  result->hashjoinoperator = InvalidOid;
367  result->left_bucketsize = rinfo->right_bucketsize;
368  result->right_bucketsize = rinfo->left_bucketsize;
369  result->left_mcvfreq = rinfo->right_mcvfreq;
370  result->right_mcvfreq = rinfo->left_mcvfreq;
371  result->hasheqoperator = InvalidOid;
372 
373  return result;
374 }
375 
376 /*
377  * restriction_is_or_clause
378  *
379  * Returns t iff the restrictinfo node contains an 'or' clause.
380  */
381 bool
383 {
384  if (restrictinfo->orclause != NULL)
385  return true;
386  else
387  return false;
388 }
389 
390 /*
391  * restriction_is_securely_promotable
392  *
393  * Returns true if it's okay to evaluate this clause "early", that is before
394  * other restriction clauses attached to the specified relation.
395  */
396 bool
398  RelOptInfo *rel)
399 {
400  /*
401  * It's okay if there are no baserestrictinfo clauses for the rel that
402  * would need to go before this one, *or* if this one is leakproof.
403  */
404  if (restrictinfo->security_level <= rel->baserestrict_min_security ||
405  restrictinfo->leakproof)
406  return true;
407  else
408  return false;
409 }
410 
411 /*
412  * get_actual_clauses
413  *
414  * Returns a list containing the bare clauses from 'restrictinfo_list'.
415  *
416  * This is only to be used in cases where none of the RestrictInfos can
417  * be pseudoconstant clauses (for instance, it's OK on indexqual lists).
418  */
419 List *
420 get_actual_clauses(List *restrictinfo_list)
421 {
422  List *result = NIL;
423  ListCell *l;
424 
425  foreach(l, restrictinfo_list)
426  {
428 
429  Assert(!rinfo->pseudoconstant);
430 
431  result = lappend(result, rinfo->clause);
432  }
433  return result;
434 }
435 
436 /*
437  * extract_actual_clauses
438  *
439  * Extract bare clauses from 'restrictinfo_list', returning either the
440  * regular ones or the pseudoconstant ones per 'pseudoconstant'.
441  */
442 List *
443 extract_actual_clauses(List *restrictinfo_list,
444  bool pseudoconstant)
445 {
446  List *result = NIL;
447  ListCell *l;
448 
449  foreach(l, restrictinfo_list)
450  {
452 
453  if (rinfo->pseudoconstant == pseudoconstant)
454  result = lappend(result, rinfo->clause);
455  }
456  return result;
457 }
458 
459 /*
460  * extract_actual_join_clauses
461  *
462  * Extract bare clauses from 'restrictinfo_list', separating those that
463  * semantically match the join level from those that were pushed down.
464  * Pseudoconstant clauses are excluded from the results.
465  *
466  * This is only used at outer joins, since for plain joins we don't care
467  * about pushed-down-ness.
468  */
469 void
471  Relids joinrelids,
472  List **joinquals,
473  List **otherquals)
474 {
475  ListCell *l;
476 
477  *joinquals = NIL;
478  *otherquals = NIL;
479 
480  foreach(l, restrictinfo_list)
481  {
483 
484  if (RINFO_IS_PUSHED_DOWN(rinfo, joinrelids))
485  {
486  if (!rinfo->pseudoconstant)
487  *otherquals = lappend(*otherquals, rinfo->clause);
488  }
489  else
490  {
491  /* joinquals shouldn't have been marked pseudoconstant */
492  Assert(!rinfo->pseudoconstant);
493  *joinquals = lappend(*joinquals, rinfo->clause);
494  }
495  }
496 }
497 
498 
499 /*
500  * join_clause_is_movable_to
501  * Test whether a join clause is a safe candidate for parameterization
502  * of a scan on the specified base relation.
503  *
504  * A movable join clause is one that can safely be evaluated at a rel below
505  * its normal semantic level (ie, its required_relids), if the values of
506  * variables that it would need from other rels are provided.
507  *
508  * We insist that the clause actually reference the target relation; this
509  * prevents undesirable movement of degenerate join clauses, and ensures
510  * that there is a unique place that a clause can be moved down to.
511  *
512  * We cannot move an outer-join clause into the non-nullable side of its
513  * outer join, as that would change the results (rows would be suppressed
514  * rather than being null-extended).
515  *
516  * Also there must not be an outer join below the clause that would null the
517  * Vars coming from the target relation. Otherwise the clause might give
518  * results different from what it would give at its normal semantic level.
519  *
520  * Also, the join clause must not use any relations that have LATERAL
521  * references to the target relation, since we could not put such rels on
522  * the outer side of a nestloop with the target relation.
523  */
524 bool
526 {
527  /* Clause must physically reference target rel */
528  if (!bms_is_member(baserel->relid, rinfo->clause_relids))
529  return false;
530 
531  /* Cannot move an outer-join clause into the join's outer side */
532  if (bms_is_member(baserel->relid, rinfo->outer_relids))
533  return false;
534 
535  /* Target rel must not be nullable below the clause */
536  if (bms_is_member(baserel->relid, rinfo->nullable_relids))
537  return false;
538 
539  /* Clause must not use any rels with LATERAL references to this rel */
540  if (bms_overlap(baserel->lateral_referencers, rinfo->clause_relids))
541  return false;
542 
543  return true;
544 }
545 
546 /*
547  * join_clause_is_movable_into
548  * Test whether a join clause is movable and can be evaluated within
549  * the current join context.
550  *
551  * currentrelids: the relids of the proposed evaluation location
552  * current_and_outer: the union of currentrelids and the required_outer
553  * relids (parameterization's outer relations)
554  *
555  * The API would be a bit clearer if we passed the current relids and the
556  * outer relids separately and did bms_union internally; but since most
557  * callers need to apply this function to multiple clauses, we make the
558  * caller perform the union.
559  *
560  * Obviously, the clause must only refer to Vars available from the current
561  * relation plus the outer rels. We also check that it does reference at
562  * least one current Var, ensuring that the clause will be pushed down to
563  * a unique place in a parameterized join tree. And we check that we're
564  * not pushing the clause into its outer-join outer side, nor down into
565  * a lower outer join's inner side.
566  *
567  * The check about pushing a clause down into a lower outer join's inner side
568  * is only approximate; it sometimes returns "false" when actually it would
569  * be safe to use the clause here because we're still above the outer join
570  * in question. This is okay as long as the answers at different join levels
571  * are consistent: it just means we might sometimes fail to push a clause as
572  * far down as it could safely be pushed. It's unclear whether it would be
573  * worthwhile to do this more precisely. (But if it's ever fixed to be
574  * exactly accurate, there's an Assert in get_joinrel_parampathinfo() that
575  * should be re-enabled.)
576  *
577  * There's no check here equivalent to join_clause_is_movable_to's test on
578  * lateral_referencers. We assume the caller wouldn't be inquiring unless
579  * it'd verified that the proposed outer rels don't have lateral references
580  * to the current rel(s). (If we are considering join paths with the outer
581  * rels on the outside and the current rels on the inside, then this should
582  * have been checked at the outset of such consideration; see join_is_legal
583  * and the path parameterization checks in joinpath.c.) On the other hand,
584  * in join_clause_is_movable_to we are asking whether the clause could be
585  * moved for some valid set of outer rels, so we don't have the benefit of
586  * relying on prior checks for lateral-reference validity.
587  *
588  * Note: if this returns true, it means that the clause could be moved to
589  * this join relation, but that doesn't mean that this is the lowest join
590  * it could be moved to. Caller may need to make additional calls to verify
591  * that this doesn't succeed on either of the inputs of a proposed join.
592  *
593  * Note: get_joinrel_parampathinfo depends on the fact that if
594  * current_and_outer is NULL, this function will always return false
595  * (since one or the other of the first two tests must fail).
596  */
597 bool
599  Relids currentrelids,
600  Relids current_and_outer)
601 {
602  /* Clause must be evaluable given available context */
603  if (!bms_is_subset(rinfo->clause_relids, current_and_outer))
604  return false;
605 
606  /* Clause must physically reference at least one target rel */
607  if (!bms_overlap(currentrelids, rinfo->clause_relids))
608  return false;
609 
610  /* Cannot move an outer-join clause into the join's outer side */
611  if (bms_overlap(currentrelids, rinfo->outer_relids))
612  return false;
613 
614  /*
615  * Target rel(s) must not be nullable below the clause. This is
616  * approximate, in the safe direction, because the current join might be
617  * above the join where the nulling would happen, in which case the clause
618  * would work correctly here. But we don't have enough info to be sure.
619  */
620  if (bms_overlap(currentrelids, rinfo->nullable_relids))
621  return false;
622 
623  return true;
624 }
QualCost eval_cost
Definition: pathnodes.h:2096
#define list_make2(x1, x2)
Definition: pg_list.h:208
#define NIL
Definition: pg_list.h:65
Relids pull_varnos(PlannerInfo *root, Node *node)
Definition: var.c:97
bool contain_leaked_vars(Node *clause)
Definition: clauses.c:1149
Index security_level
Definition: pathnodes.h:2071
Relids required_relids
Definition: pathnodes.h:2077
Selectivity right_mcvfreq
Definition: pathnodes.h:2123
void extract_actual_join_clauses(List *restrictinfo_list, Relids joinrelids, List **joinquals, List **otherquals)
Definition: restrictinfo.c:470
bool leakproof
Definition: pathnodes.h:2066
static bool is_orclause(const void *clause)
Definition: nodeFuncs.h:106
#define castNode(_type_, nodeptr)
Definition: nodes.h:605
Expr * orclause
Definition: pathnodes.h:2090
static RestrictInfo * make_restrictinfo_internal(PlannerInfo *root, Expr *clause, Expr *orclause, bool is_pushed_down, bool outerjoin_delayed, bool pseudoconstant, Index security_level, Relids required_relids, Relids outer_relids, Relids nullable_relids)
Definition: restrictinfo.c:107
Relids clause_relids
Definition: pathnodes.h:2074
bool pseudoconstant
Definition: pathnodes.h:2064
static bool is_andclause(const void *clause)
Definition: nodeFuncs.h:97
Definition: nodes.h:536
List * get_actual_clauses(List *restrictinfo_list)
Definition: restrictinfo.c:420
Relids left_relids
Definition: pathnodes.h:2086
EquivalenceClass * right_ec
Definition: pathnodes.h:2108
Index baserestrict_min_security
Definition: pathnodes.h:747
unsigned int Oid
Definition: postgres_ext.h:31
Expr * make_orclause(List *orclauses)
Definition: makefuncs.c:652
List * mergeopfamilies
Definition: pathnodes.h:2104
bool restriction_is_or_clause(RestrictInfo *restrictinfo)
Definition: restrictinfo.c:382
#define lsecond(l)
Definition: pg_list.h:179
Cost startup
Definition: pathnodes.h:45
Relids outer_relids
Definition: pathnodes.h:2080
Selectivity norm_selec
Definition: pathnodes.h:2097
static Expr * make_sub_restrictinfos(PlannerInfo *root, Expr *clause, bool is_pushed_down, bool outerjoin_delayed, bool pseudoconstant, Index security_level, Relids required_relids, Relids outer_relids, Relids nullable_relids)
Definition: restrictinfo.c:243
#define linitial(l)
Definition: pg_list.h:174
EquivalenceMember * left_em
Definition: pathnodes.h:2109
EquivalenceClass * parent_ec
Definition: pathnodes.h:2093
bool bms_is_subset(const Bitmapset *a, const Bitmapset *b)
Definition: bitmapset.c:315
bool outerjoin_delayed
Definition: pathnodes.h:2060
#define lfirst_node(type, lc)
Definition: pg_list.h:172
RestrictInfo * commute_restrictinfo(RestrictInfo *rinfo, Oid comm_op)
Definition: restrictinfo.c:326
Expr * make_andclause(List *andclauses)
Definition: makefuncs.c:636
bool outer_is_left
Definition: pathnodes.h:2114
Selectivity outer_selec
Definition: pathnodes.h:2100
static Node * get_leftop(const void *clause)
Definition: nodeFuncs.h:73
RestrictInfo * make_restrictinfo(PlannerInfo *root, Expr *clause, bool is_pushed_down, bool outerjoin_delayed, bool pseudoconstant, Index security_level, Relids required_relids, Relids outer_relids, Relids nullable_relids)
Definition: restrictinfo.c:61
bool join_clause_is_movable_into(RestrictInfo *rinfo, Relids currentrelids, Relids current_and_outer)
Definition: restrictinfo.c:598
VolatileFunctionStatus has_volatile
Definition: pathnodes.h:2068
Index relid
Definition: pathnodes.h:709
Oid hasheqoperator
Definition: pathnodes.h:2126
List * lappend(List *list, void *datum)
Definition: list.c:336
Relids lateral_referencers
Definition: pathnodes.h:717
EquivalenceMember * right_em
Definition: pathnodes.h:2110
Expr * clause
Definition: pathnodes.h:2056
bool bms_is_empty(const Bitmapset *a)
Definition: bitmapset.c:701
Relids nullable_relids
Definition: pathnodes.h:2083
Oid opfuncid
Definition: primnodes.h:543
unsigned int Index
Definition: c.h:549
static Node * get_rightop(const void *clause)
Definition: nodeFuncs.h:85
#define RINFO_IS_PUSHED_DOWN(rinfo, joinrelids)
Definition: pathnodes.h:2139
#define InvalidOid
Definition: postgres_ext.h:36
bool is_pushed_down
Definition: pathnodes.h:2058
Selectivity left_bucketsize
Definition: pathnodes.h:2120
#define makeNode(_type_)
Definition: nodes.h:584
Relids right_relids
Definition: pathnodes.h:2087
#define Assert(condition)
Definition: c.h:804
#define lfirst(lc)
Definition: pg_list.h:169
bool restriction_is_securely_promotable(RestrictInfo *restrictinfo, RelOptInfo *rel)
Definition: restrictinfo.c:397
Selectivity left_mcvfreq
Definition: pathnodes.h:2122
Bitmapset * bms_union(const Bitmapset *a, const Bitmapset *b)
Definition: bitmapset.c:225
Oid hashjoinoperator
Definition: pathnodes.h:2117
static int list_length(const List *l)
Definition: pg_list.h:149
List * extract_actual_clauses(List *restrictinfo_list, bool pseudoconstant)
Definition: restrictinfo.c:443
bool join_clause_is_movable_to(RestrictInfo *rinfo, RelOptInfo *baserel)
Definition: restrictinfo.c:525
bool bms_overlap(const Bitmapset *a, const Bitmapset *b)
Definition: bitmapset.c:494
Selectivity right_bucketsize
Definition: pathnodes.h:2121
EquivalenceClass * left_ec
Definition: pathnodes.h:2107
Oid opno
Definition: primnodes.h:542
static bool is_opclause(const void *clause)
Definition: nodeFuncs.h:66
List * args
Definition: primnodes.h:548
Definition: pg_list.h:50
bool bms_is_member(int x, const Bitmapset *a)
Definition: bitmapset.c:427
List * scansel_cache
Definition: pathnodes.h:2111