1 /*-------------------------------------------------------------------------
2  *
3  * intermediate_result_pruning.h
4  *   Functions for pruning intermediate result broadcasting.
5  *
6  * Copyright (c) Citus Data, Inc.
7  *
8  *-------------------------------------------------------------------------
9  */
10 
11 #ifndef INTERMEDIATE_RESULT_PRUNING_H
12 #define INTERMEDIATE_RESULT_PRUNING_H
13 
14 #include "distributed/subplan_execution.h"
15 
16 /*
17  * UINT32_MAX is reserved in pg_dist_node, so we can use it safely.
18  */
19 #define LOCAL_NODE_ID UINT32_MAX
20 
21 /*
22  * If you want to connect to the current node use `LocalHostName`, which is a GUC, instead
23  * of the hardcoded loopback hostname. Only if you really need the loopback hostname use
24  * this define.
25  */
26 #define LOCAL_HOST_NAME "localhost"
27 
28 extern bool LogIntermediateResults;
29 
30 extern List * FindSubPlanUsages(DistributedPlan *plan);
31 extern List * FindAllWorkerNodesUsingSubplan(HTAB *intermediateResultsHash,
32 											 char *resultId);
33 extern HTAB * MakeIntermediateResultHTAB(void);
34 extern void RecordSubplanExecutionsOnNodes(HTAB *intermediateResultsHash,
35 										   DistributedPlan *distributedPlan);
36 extern IntermediateResultsHashEntry * SearchIntermediateResult(HTAB *resultsHash,
37 															   char *resultId);
38 
39 #endif /* INTERMEDIATE_RESULT_PRUNING_H */
40