MCPcopy Create free account
hub / github.com/apache/cloudberry / classifyConditions

Function classifyConditions

contrib/postgres_fdw/deparse.c:209–230  ·  view source on GitHub ↗

* Examine each qual clause in input_conds, and classify them into two groups, * which are returned as two lists: * - remote_conds contains expressions that can be evaluated remotely * - local_conds contains expressions that can't be evaluated remotely */

Source from the content-addressed store, hash-verified

207 * - local_conds contains expressions that can't be evaluated remotely
208 */
209void
210classifyConditions(PlannerInfo *root,
211 RelOptInfo *baserel,
212 List *input_conds,
213 List **remote_conds,
214 List **local_conds)
215{
216 ListCell *lc;
217
218 *remote_conds = NIL;
219 *local_conds = NIL;
220
221 foreach(lc, input_conds)
222 {
223 RestrictInfo *ri = lfirst_node(RestrictInfo, lc);
224
225 if (is_foreign_expr(root, baserel, ri->clause))
226 *remote_conds = lappend(*remote_conds, ri);
227 else
228 *local_conds = lappend(*local_conds, ri);
229 }
230}
231
232/*
233 * Returns true if given expr is safe to evaluate on the foreign server.

Callers 2

estimate_path_cost_sizeFunction · 0.70

Calls 3

is_foreign_exprFunction · 0.85
lappendFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected