}
/*
- * A custom callback for ChangeVarNodesExtended() providing
- * Self-join elimination (SJE) related functionality
+ * A custom callback for ChangeVarNodesExtended() providing Self-join
+ * elimination (SJE) related functionality
*
- * SJE needs to skip the RangeTblRef node
- * type. During SJE's last step, remove_rel_from_joinlist() removes
- * remaining RangeTblRefs with target relid. If ChangeVarNodes() replaces
- * the target relid before, remove_rel_from_joinlist() fails to identify
- * the nodes to delete.
+ * SJE needs to skip the RangeTblRef node type. During SJE's last
+ * step, remove_rel_from_joinlist() removes remaining RangeTblRefs
+ * with target relid. If ChangeVarNodes() replaces the target relid
+ * before, remove_rel_from_joinlist() would fail to identify the nodes
+ * to delete.
*
* SJE also needs to change the relids within RestrictInfo's.
*/
/*
* For self-join elimination, changing varnos could transform
* "t1.a = t2.a" into "t1.a = t1.a". That is always true as long
- * as "t1.a" is not null. We use qual() to check for such a case,
- * and then we replace the qual for a check for not null
+ * as "t1.a" is not null. We use equal() to check for such a
+ * case, and then we replace the qual with a check for not null
* (NullTest).
*/
if (leftOp != NULL && equal(leftOp, rightOp))
* (identified by sublevels_up and rt_index), and change their varno fields
* to 'new_index'. The varnosyn fields are changed too. Also, adjust other
* nodes that contain rangetable indexes, such as RangeTblRef and JoinExpr.
- * Specifying 'change_RangeTblRef' to false allows skipping RangeTblRef.
- * See ChangeVarNodesExtended for details.
*
* NOTE: although this has the form of a walker, we cheat and modify the
* nodes in-place. The given expression tree should have been copied
}
/*
- * ChangeVarNodesExtended - similar to ChangeVarNodes, but with an additional
+ * ChangeVarNodesExtended - similar to ChangeVarNodes, but with an additional
* 'callback' param
*
- * ChangeVarNodes changes a given node and all of its underlying nodes.
- * This version of function additionally takes a callback, which has a
- * chance to process a node before ChangeVarNodes_walker. A callback
- * returns a boolean value indicating if given node should be skipped from
- * further processing by ChangeVarNodes_walker. The callback is called
- * only for expressions and other children nodes of a Query processed by
- * a walker. Initial processing of the root Query doesn't involve the
- * callback.
+ * ChangeVarNodes changes a given node and all of its underlying nodes. This
+ * version of function additionally takes a callback, which has a chance to
+ * process a node before ChangeVarNodes_walker. A callback returns a boolean
+ * value indicating if the given node should be skipped from further processing
+ * by ChangeVarNodes_walker. The callback is called only for expressions and
+ * other children nodes of a Query processed by a walker. Initial processing
+ * of the root Query doesn't involve the callback.
*/
void
ChangeVarNodesExtended(Node *node, int rt_index, int new_index,