CustomScanAPI

From PostgreSQL wiki

Revision as of 20:27, 7 November 2013 by Kaigai (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Overview

CustomScan Fig01.png


Related Hooks

add_scan_path_hook

typedef void (*add_scan_path_hook_type)(PlannerInfo *root,
                                       RelOptInfo *baserel,
                                       RangeTblEntry *rte);
extern PGDLLIMPORT add_scan_path_hook_type add_scan_path_hook;

add_join_path_hook

typedef void (*add_join_path_hook_type)(PlannerInfo *root,
                                       RelOptInfo *joinrel,
                                       RelOptInfo *outerrel,
                                       RelOptInfo *innerrel,
                                       JoinType jointype,
                                       SpecialJoinInfo *sjinfo,
                                       List *restrictlist,
                                       List *mergeclause_list,
                                       SemiAntiJoinFactors *semifactors,
                                       Relids param_source_rels,
                                       Relids extra_lateral_rels);
extern PGDLLIMPORT add_join_path_hook_type add_join_path_hook;




CustomScan Provider

register_custom_provider

typedef struct CustomProvider
{
   char                            name[NAMEDATALEN];

   InitCustomScanPlan_function     InitCustomScanPlan;
   SetPlanRefCustomScan_function   SetPlanRefCustomScan;

   BeginCustomScan_function        BeginCustomScan;
   ExecCustomScan_function         ExecCustomScan;
   MultiExecCustomScan_function    MultiExecCustomScan;
   EndCustomScan_function          EndCustomScan;

   ReScanCustomScan_function       ReScanCustomScan;
   ExecMarkPosCustomScan_function  ExecMarkPosCustomScan;
   ExecRestorePosCustom_function   ExecRestorePosCustom;

   ExplainCustomScan_function      ExplainCustomScan;
} CustomProvider;

void register_custom_provider(const CustomProvider *provider);

InitCustomScanPlan

void InitCustomScanPlan(PlannerInfo *root,
                        CustomScan *cscan_plan,
                        CustomPath *cscan_path,
                        List *tlist,
                        List *scan_clauses);

SetPlanRefCustomScan

void SetPlanRefCustomScan(PlannerInfo *root,
                          CustomScan *cscan_plan,
                          int rtoffset);

BeginCustomScan

void BeginCustomScan(CustomScanState *csstate, int eflags)

ExecCustomScan

TupleTableSlot *ExecCustomScan(CustomScanState *csstate);

MultiExecCustomScan

Node *MultiExecCustomScan(CustomScanState *csstate);

EndCustomScan

void EndCustomScan(CustomScanState *csstate);

ReScanCustomScan

void ReScanCustomScan(CustomScanState *csstate);

ExecMarkPosCustomScan

void ExecMarkPosCustomScan(CustomScanState *csstate);

ExecRestorePosCustom

void ExecRestorePosCustom(CustomScanState *csstate);

ExplainCustomScan

void ExplainCustomScan(CustomScanState *csstate,
                       ExplainState *es);
Personal tools