mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +03:00
Redesign PlanForeignScan API to allow multiple paths for a foreign table.
The original API specification only allowed an FDW to create a single access path, which doesn't seem like a terribly good idea in hindsight. Instead, move the responsibility for building the Path node and calling add_path() into the FDW's PlanForeignScan function. Now, it can do that more than once if appropriate. There is no longer any need for the transient FdwPlan struct, so get rid of that. Etsuro Fujita, Shigeru Hanada, Tom Lane
This commit is contained in:
@ -23,7 +23,8 @@
|
||||
#include "postgres.h"
|
||||
|
||||
#include "miscadmin.h"
|
||||
#include "foreign/fdwapi.h"
|
||||
#include "nodes/plannodes.h"
|
||||
#include "nodes/relation.h"
|
||||
#include "utils/datum.h"
|
||||
|
||||
|
||||
@ -591,21 +592,6 @@ _copyForeignScan(const ForeignScan *from)
|
||||
* copy remainder of node
|
||||
*/
|
||||
COPY_SCALAR_FIELD(fsSystemCol);
|
||||
COPY_NODE_FIELD(fdwplan);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
/*
|
||||
* _copyFdwPlan
|
||||
*/
|
||||
static FdwPlan *
|
||||
_copyFdwPlan(const FdwPlan *from)
|
||||
{
|
||||
FdwPlan *newnode = makeNode(FdwPlan);
|
||||
|
||||
COPY_SCALAR_FIELD(startup_cost);
|
||||
COPY_SCALAR_FIELD(total_cost);
|
||||
COPY_NODE_FIELD(fdw_private);
|
||||
|
||||
return newnode;
|
||||
@ -3842,9 +3828,6 @@ copyObject(const void *from)
|
||||
case T_ForeignScan:
|
||||
retval = _copyForeignScan(from);
|
||||
break;
|
||||
case T_FdwPlan:
|
||||
retval = _copyFdwPlan(from);
|
||||
break;
|
||||
case T_Join:
|
||||
retval = _copyJoin(from);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user