|
| 1 | +/* |
| 2 | + * expath.c |
| 3 | + * |
| 4 | + */ |
| 5 | + |
| 6 | +#include"postgres.h" |
| 7 | + |
| 8 | +#include"optimizer/pathnode.h" |
| 9 | + |
| 10 | +#include"expath.h" |
| 11 | + |
| 12 | + |
| 13 | +/* |
| 14 | + * FDW paths and EXCHANGE paths are incompatible and can't be combined at a plan. |
| 15 | + * We need to construct two non-intersecting path branches across all plan. |
| 16 | + * Costs of this plans is not an indicator of path quality at intermediate |
| 17 | + * stages of a plan building. We need bypass add_path() path checking procedure. |
| 18 | + */ |
| 19 | +void |
| 20 | +force_add_path(RelOptInfo*rel,Path*path) |
| 21 | +{ |
| 22 | +List*pathlist=rel->pathlist; |
| 23 | + |
| 24 | +rel->pathlist=NIL; |
| 25 | +rel->cheapest_parameterized_paths=NIL; |
| 26 | +rel->cheapest_startup_path=rel->cheapest_total_path= |
| 27 | +rel->cheapest_unique_path=NULL; |
| 28 | +add_path(rel,path); |
| 29 | +rel->pathlist=list_concat(rel->pathlist,pathlist); |
| 30 | +set_cheapest(rel); |
| 31 | +} |