* 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 */
| 207 | * - local_conds contains expressions that can't be evaluated remotely |
| 208 | */ |
| 209 | void |
| 210 | classifyConditions(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. |
no test coverage detected