/*
* init_dummy_sjinfo
- * Populate the given SpecialJoinInfo for a plain inner join between rel1
- * and rel2
+ * Populate the given SpecialJoinInfo for a plain inner join between the
+ * left and right relations specified by left_relids and right_relids
+ * respectively.
*
* Normally, an inner join does not have a SpecialJoinInfo node associated with
* it. But some functions involved in join planning require one containing at
#include "nodes/nodeFuncs.h"
#include "optimizer/optimizer.h"
#include "optimizer/orclauses.h"
+#include "optimizer/paths.h"
#include "optimizer/restrictinfo.h"
* Make up a SpecialJoinInfo for JOIN_INNER semantics. (Compare
* approx_tuple_count() in costsize.c.)
*/
- sjinfo.type = T_SpecialJoinInfo;
- sjinfo.min_lefthand = bms_difference(join_or_rinfo->clause_relids,
- rel->relids);
- sjinfo.min_righthand = rel->relids;
- sjinfo.syn_lefthand = sjinfo.min_lefthand;
- sjinfo.syn_righthand = sjinfo.min_righthand;
- sjinfo.jointype = JOIN_INNER;
- sjinfo.ojrelid = 0;
- sjinfo.commute_above_l = NULL;
- sjinfo.commute_above_r = NULL;
- sjinfo.commute_below_l = NULL;
- sjinfo.commute_below_r = NULL;
- /* we don't bother trying to make the remaining fields valid */
- sjinfo.lhs_strict = false;
- sjinfo.semi_can_btree = false;
- sjinfo.semi_can_hash = false;
- sjinfo.semi_operators = NIL;
- sjinfo.semi_rhs_exprs = NIL;
+ init_dummy_sjinfo(&sjinfo,
+ bms_difference(join_or_rinfo->clause_relids,
+ rel->relids),
+ rel->relids);
/* Compute inner-join size */
orig_selec = clause_selectivity(root, (Node *) join_or_rinfo,