postgres 9.5 FDW变化

本文对比了PostgreSQL 9.4与9.5版本中关于foreign data wrapper (FDW)的两个关键函数create_foreignscan_path及make_foreignscan的变化。9.5版本在create_foreignscan_path中新增了一个Path*fdw_outerpath参数,在make_foreignscan中增加了3个参数,包括List*fdw_scan_tlist、List*fdw_recheck_quals和Plan*outer_plan。这些改动为使用FDW提供了更多的灵活性。

9.5主要是2个方法有变动:

create_foreignscan_path

extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel,
						double rows, Cost startup_cost, Cost total_cost,
						List *pathkeys,
						Relids required_outer,
						Path *fdw_outerpath,
						List *fdw_private);

 

9.4比9.5少了个Path *fdw_outerpath

extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel,
						double rows, Cost startup_cost, Cost total_cost,
						List *pathkeys,
						Relids required_outer,
						List *fdw_private);

 

make_foreignscan

这个函数在9.5中添加了3个参数:

extern ForeignScan *make_foreignscan(List *qptlist, List *qpqual,
				 Index scanrelid, List *fdw_exprs, List *fdw_private,
				 List *fdw_scan_tlist, List *fdw_recheck_quals,
				 Plan *outer_plan);

 

9.4中的make_foreignscan

extern ForeignScan *make_foreignscan(List *qptlist, List *qpqual,
				 Index scanrelid, List *fdw_exprs, List *fdw_private);

 

在接口fdwroutine->GetForeignPlan中需要添加一个Plan *outer_plan

 

这样就能快乐的在9.5上面玩耍fdw了

转载于:https://www.cnblogs.com/sangli/p/5437148.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值