PostgreSQL Source Code git master
Loading...
Searching...
No Matches
extendplan.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * extendplan.h
4 * Extend core planner objects with additional private state
5 *
6 *
7 * Portions Copyright (c) 1996-2026, 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
19extern int GetPlannerExtensionId(const char *extension_name);
20
21/*
22 * Get extension-specific state from a PlannerGlobal.
23 */
24static inline void *
26{
27 Assert(extension_id >= 0);
28
30 return NULL;
31
32 return glob->extension_state[extension_id];
33}
34
35/*
36 * Get extension-specific state from a PlannerInfo.
37 */
38static inline void *
40{
41 Assert(extension_id >= 0);
42
43 if (extension_id >= root->extension_state_allocated)
44 return NULL;
45
46 return root->extension_state[extension_id];
47}
48
49/*
50 * Get extension-specific state from a PlannerInfo.
51 */
52static inline void *
54{
55 Assert(extension_id >= 0);
56
58 return NULL;
59
60 return rel->extension_state[extension_id];
61}
62
63/* Functions to store private state into various planner objects */
65 int extension_id,
66 void *opaque);
68 void *opaque);
70 void *opaque);
71
72#endif
#define Assert(condition)
Definition c.h:873
static void * GetPlannerGlobalExtensionState(PlannerGlobal *glob, int extension_id)
Definition extendplan.h:25
static void * GetRelOptInfoExtensionState(RelOptInfo *rel, int extension_id)
Definition extendplan.h:53
static void * GetPlannerInfoExtensionState(PlannerInfo *root, int extension_id)
Definition extendplan.h:39
void SetRelOptInfoExtensionState(RelOptInfo *rel, int extension_id, void *opaque)
Definition extendplan.c:147
void SetPlannerInfoExtensionState(PlannerInfo *root, int extension_id, void *opaque)
Definition extendplan.c:113
int GetPlannerExtensionId(const char *extension_name)
Definition extendplan.c:41
void SetPlannerGlobalExtensionState(PlannerGlobal *glob, int extension_id, void *opaque)
Definition extendplan.c:77
static int fb(int x)
tree ctl root
Definition radixtree.h:1857
int extension_state_allocated
Definition pathnodes.h:267
int extension_state_allocated
Definition pathnodes.h:1202