/src/postgres/src/include/optimizer/extendplan.h
Line | Count | Source |
1 | | /*------------------------------------------------------------------------- |
2 | | * |
3 | | * extendplan.h |
4 | | * Extend core planner objects with additional private state |
5 | | * |
6 | | * |
7 | | * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group |
8 | | * Portions Copyright (c) 1994, Regents of the University of California |
9 | | * |
10 | | * src/include/optimizer/extendplan.h |
11 | | * |
12 | | *------------------------------------------------------------------------- |
13 | | */ |
14 | | #ifndef EXTENDPLAN_H |
15 | | #define EXTENDPLAN_H |
16 | | |
17 | | #include "nodes/pathnodes.h" |
18 | | |
19 | | extern int GetPlannerExtensionId(const char *extension_name); |
20 | | |
21 | | /* |
22 | | * Get extension-specific state from a PlannerGlobal. |
23 | | */ |
24 | | static inline void * |
25 | | GetPlannerGlobalExtensionState(PlannerGlobal *glob, int extension_id) |
26 | 0 | { |
27 | 0 | Assert(extension_id >= 0); |
28 | 0 |
|
29 | 0 | if (extension_id >= glob->extension_state_allocated) |
30 | 0 | return NULL; |
31 | 0 |
|
32 | 0 | return glob->extension_state[extension_id]; |
33 | 0 | } Unexecuted instantiation: geqo_copy.c:GetPlannerGlobalExtensionState Unexecuted instantiation: geqo_cx.c:GetPlannerGlobalExtensionState Unexecuted instantiation: geqo_erx.c:GetPlannerGlobalExtensionState Unexecuted instantiation: geqo_eval.c:GetPlannerGlobalExtensionState Unexecuted instantiation: geqo_main.c:GetPlannerGlobalExtensionState Unexecuted instantiation: geqo_misc.c:GetPlannerGlobalExtensionState Unexecuted instantiation: geqo_mutation.c:GetPlannerGlobalExtensionState Unexecuted instantiation: geqo_ox1.c:GetPlannerGlobalExtensionState Unexecuted instantiation: geqo_ox2.c:GetPlannerGlobalExtensionState Unexecuted instantiation: geqo_pmx.c:GetPlannerGlobalExtensionState Unexecuted instantiation: geqo_pool.c:GetPlannerGlobalExtensionState Unexecuted instantiation: geqo_px.c:GetPlannerGlobalExtensionState Unexecuted instantiation: geqo_random.c:GetPlannerGlobalExtensionState Unexecuted instantiation: geqo_recombination.c:GetPlannerGlobalExtensionState Unexecuted instantiation: geqo_selection.c:GetPlannerGlobalExtensionState Unexecuted instantiation: allpaths.c:GetPlannerGlobalExtensionState Unexecuted instantiation: extendplan.c:GetPlannerGlobalExtensionState Unexecuted instantiation: guc_tables.c:GetPlannerGlobalExtensionState |
34 | | |
35 | | /* |
36 | | * Get extension-specific state from a PlannerInfo. |
37 | | */ |
38 | | static inline void * |
39 | | GetPlannerInfoExtensionState(PlannerInfo *root, int extension_id) |
40 | 0 | { |
41 | 0 | Assert(extension_id >= 0); |
42 | |
|
43 | 0 | if (extension_id >= root->extension_state_allocated) |
44 | 0 | return NULL; |
45 | | |
46 | 0 | return root->extension_state[extension_id]; |
47 | 0 | } Unexecuted instantiation: geqo_copy.c:GetPlannerInfoExtensionState Unexecuted instantiation: geqo_cx.c:GetPlannerInfoExtensionState Unexecuted instantiation: geqo_erx.c:GetPlannerInfoExtensionState Unexecuted instantiation: geqo_eval.c:GetPlannerInfoExtensionState Unexecuted instantiation: geqo_main.c:GetPlannerInfoExtensionState Unexecuted instantiation: geqo_misc.c:GetPlannerInfoExtensionState Unexecuted instantiation: geqo_mutation.c:GetPlannerInfoExtensionState Unexecuted instantiation: geqo_ox1.c:GetPlannerInfoExtensionState Unexecuted instantiation: geqo_ox2.c:GetPlannerInfoExtensionState Unexecuted instantiation: geqo_pmx.c:GetPlannerInfoExtensionState Unexecuted instantiation: geqo_pool.c:GetPlannerInfoExtensionState Unexecuted instantiation: geqo_px.c:GetPlannerInfoExtensionState Unexecuted instantiation: geqo_random.c:GetPlannerInfoExtensionState Unexecuted instantiation: geqo_recombination.c:GetPlannerInfoExtensionState Unexecuted instantiation: geqo_selection.c:GetPlannerInfoExtensionState Unexecuted instantiation: allpaths.c:GetPlannerInfoExtensionState Unexecuted instantiation: extendplan.c:GetPlannerInfoExtensionState Unexecuted instantiation: guc_tables.c:GetPlannerInfoExtensionState |
48 | | |
49 | | /* |
50 | | * Get extension-specific state from a PlannerInfo. |
51 | | */ |
52 | | static inline void * |
53 | | GetRelOptInfoExtensionState(RelOptInfo *rel, int extension_id) |
54 | 0 | { |
55 | 0 | Assert(extension_id >= 0); |
56 | 0 |
|
57 | 0 | if (extension_id >= rel->extension_state_allocated) |
58 | 0 | return NULL; |
59 | 0 |
|
60 | 0 | return rel->extension_state[extension_id]; |
61 | 0 | } Unexecuted instantiation: geqo_copy.c:GetRelOptInfoExtensionState Unexecuted instantiation: geqo_cx.c:GetRelOptInfoExtensionState Unexecuted instantiation: geqo_erx.c:GetRelOptInfoExtensionState Unexecuted instantiation: geqo_eval.c:GetRelOptInfoExtensionState Unexecuted instantiation: geqo_main.c:GetRelOptInfoExtensionState Unexecuted instantiation: geqo_misc.c:GetRelOptInfoExtensionState Unexecuted instantiation: geqo_mutation.c:GetRelOptInfoExtensionState Unexecuted instantiation: geqo_ox1.c:GetRelOptInfoExtensionState Unexecuted instantiation: geqo_ox2.c:GetRelOptInfoExtensionState Unexecuted instantiation: geqo_pmx.c:GetRelOptInfoExtensionState Unexecuted instantiation: geqo_pool.c:GetRelOptInfoExtensionState Unexecuted instantiation: geqo_px.c:GetRelOptInfoExtensionState Unexecuted instantiation: geqo_random.c:GetRelOptInfoExtensionState Unexecuted instantiation: geqo_recombination.c:GetRelOptInfoExtensionState Unexecuted instantiation: geqo_selection.c:GetRelOptInfoExtensionState Unexecuted instantiation: allpaths.c:GetRelOptInfoExtensionState Unexecuted instantiation: extendplan.c:GetRelOptInfoExtensionState Unexecuted instantiation: guc_tables.c:GetRelOptInfoExtensionState |
62 | | |
63 | | /* Functions to store private state into various planner objects */ |
64 | | extern void SetPlannerGlobalExtensionState(PlannerGlobal *glob, |
65 | | int extension_id, |
66 | | void *opaque); |
67 | | extern void SetPlannerInfoExtensionState(PlannerInfo *root, int extension_id, |
68 | | void *opaque); |
69 | | extern void SetRelOptInfoExtensionState(RelOptInfo *rel, int extension_id, |
70 | | void *opaque); |
71 | | |
72 | | #endif |