-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd_path.h
More file actions
33 lines (30 loc) · 760 Bytes
/
d_path.h
File metadata and controls
33 lines (30 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#include <optimizer/paths.h>
#include <optimizer/pathnode.h>
static void dir_fdw_estimate_cost(
PlannerInfo* p, RelOptInfo* r, DirFdwPlanState* s, Cost* c, Cost* t
){
Cost cpu = cpu_tuple_cost * 10 + r->baserestrictcost.per_tuple;
Cost run = seq_page_cost * s->pages;
run += cpu * s->ntup;
*c = r->baserestrictcost.startup;
*t = *c + run;
}
static void dir_fdw_path(PlannerInfo* p, RelOptInfo* r, Oid o){
DirFdwPlanState* s = r->fdw_private;
Cost start;
Cost total;
dir_fdw_estimate_cost(p, r, s, &start, &total);
add_path(r, (Path*)create_foreignscan_path(
p,
r,
NULL, // default pathtarget
r->rows,
start,
total,
NIL, // no pathkeys
NULL,
NULL, // no extra plan
NIL //
));
}