4141#include "foreign/fdwapi.h"
4242#include "hooks.h"
4343#include "runtimeappend.h"
44- #include "arrangeappend .h"
44+ #include "runtime_merge_append .h"
4545
4646PG_MODULE_MAGIC ;
4747
@@ -173,20 +173,20 @@ _PG_init(void)
173173runtimeappend_exec_methods .ExplainCustomScan = runtimeappend_explain ;
174174
175175/* RuntimeMergeAppend */
176- arrangeappend_path_methods .CustomName = "RuntimeMergeAppend" ;
177- arrangeappend_path_methods .PlanCustomPath = create_arrangeappend_plan ;
176+ runtime_merge_append_path_methods .CustomName = "RuntimeMergeAppend" ;
177+ runtime_merge_append_path_methods .PlanCustomPath = create_runtimemergeappend_plan ;
178178
179- arrangeappend_plan_methods .CustomName = "RuntimeMergeAppend" ;
180- arrangeappend_plan_methods .CreateCustomScanState = arrangeappend_create_scan_state ;
179+ runtime_merge_append_plan_methods .CustomName = "RuntimeMergeAppend" ;
180+ runtime_merge_append_plan_methods .CreateCustomScanState = runtimemergeappend_create_scan_state ;
181181
182- arrangeappend_exec_methods .CustomName = "RuntimeMergeAppend" ;
183- arrangeappend_exec_methods .BeginCustomScan = arrangeappend_begin ;
184- arrangeappend_exec_methods .ExecCustomScan = arrangeappend_exec ;
185- arrangeappend_exec_methods .EndCustomScan = arrangeappend_end ;
186- arrangeappend_exec_methods .ReScanCustomScan = arrangeappend_rescan ;
187- arrangeappend_exec_methods .MarkPosCustomScan = NULL ;
188- arrangeappend_exec_methods .RestrPosCustomScan = NULL ;
189- arrangeappend_exec_methods .ExplainCustomScan = arrangeappend_explain ;
182+ runtime_merge_append_exec_methods .CustomName = "RuntimeMergeAppend" ;
183+ runtime_merge_append_exec_methods .BeginCustomScan = runtimemergeappend_begin ;
184+ runtime_merge_append_exec_methods .ExecCustomScan = runtimemergeappend_exec ;
185+ runtime_merge_append_exec_methods .EndCustomScan = runtimemergeappend_end ;
186+ runtime_merge_append_exec_methods .ReScanCustomScan = runtimemergeappend_rescan ;
187+ runtime_merge_append_exec_methods .MarkPosCustomScan = NULL ;
188+ runtime_merge_append_exec_methods .RestrPosCustomScan = NULL ;
189+ runtime_merge_append_exec_methods .ExplainCustomScan = runtimemergeappend_explain ;
190190
191191DefineCustomBoolVariable ("pg_pathman.enable" ,
192192"Enables pg_pathman's optimizations during the planner stage" ,
@@ -209,6 +209,17 @@ _PG_init(void)
209209NULL ,
210210NULL ,
211211NULL );
212+
213+ DefineCustomBoolVariable ("pg_pathman.enable_runtimemergeappend" ,
214+ "Enables the planner's use of RuntimeMergeAppend custom node." ,
215+ NULL ,
216+ & pg_pathman_enable_runtime_merge_append ,
217+ true,
218+ PGC_USERSET ,
219+ 0 ,
220+ NULL ,
221+ NULL ,
222+ NULL );
212223}
213224
214225PartRelationInfo *