PostgreSQL Source Code git master
Loading...
Searching...
No Matches
pgpa_planner.h File Reference
#include "pgpa_identifier.h"
Include dependency graph for pgpa_planner.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pgpa_planner_info
 

Typedefs

typedef struct pgpa_planner_info pgpa_planner_info
 

Functions

void pgpa_planner_install_hooks (void)
 
PGDLLEXPORT void pgpa_planner_feedback_warning (List *feedback)
 

Variables

int pgpa_planner_generate_advice
 

Typedef Documentation

◆ pgpa_planner_info

Function Documentation

◆ pgpa_planner_feedback_warning()

PGDLLEXPORT void pgpa_planner_feedback_warning ( List feedback)
extern

Definition at line 1908 of file pgpa_planner.c.

1909{
1912
1913 /* Quick exit if there's no feedback. */
1914 if (feedback == NIL)
1915 return;
1916
1917 /* Initialize buffers. */
1920
1921 /* Main loop. */
1923 {
1924 int flags = defGetInt32(item);
1925
1926 /*
1927 * Don't emit anything if it was fully matched with no problems found.
1928 *
1929 * NB: Feedback should never be marked fully matched without also
1930 * being marked partially matched.
1931 */
1933 continue;
1934
1935 /*
1936 * Terminate each detail line except the last with a newline. This is
1937 * also a convenient place to reset flagbuf.
1938 */
1939 if (detailbuf.len > 0)
1940 {
1943 }
1944
1945 /* Generate output. */
1947 appendStringInfo(&detailbuf, "advice %s feedback is \"%s\"",
1948 item->defname, flagbuf.data);
1949 }
1950
1951 /* Emit the warning, if any problems were found. */
1952 if (detailbuf.len > 0)
1954 errmsg("supplied plan advice was not enforced"),
1955 errdetail("%s", detailbuf.data));
1956}
int32 defGetInt32(DefElem *def)
Definition define.c:148
int errdetail(const char *fmt,...) pg_attribute_printf(1
#define WARNING
Definition elog.h:37
#define ereport(elevel,...)
Definition elog.h:152
static char * errmsg
#define NIL
Definition pg_list.h:68
#define foreach_node(type, var, lst)
Definition pg_list.h:528
#define PGPA_FB_MATCH_FULL
#define PGPA_FB_MATCH_PARTIAL
void pgpa_trove_append_flags(StringInfo buf, int flags)
Definition pgpa_trove.c:345
static int fb(int x)
void resetStringInfo(StringInfo str)
Definition stringinfo.c:126
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition stringinfo.c:145
void appendStringInfoChar(StringInfo str, char ch)
Definition stringinfo.c:242
void initStringInfo(StringInfo str)
Definition stringinfo.c:97

References appendStringInfo(), appendStringInfoChar(), defGetInt32(), ereport, errdetail(), errmsg, fb(), foreach_node, initStringInfo(), NIL, PGPA_FB_MATCH_FULL, PGPA_FB_MATCH_PARTIAL, pgpa_trove_append_flags(), resetStringInfo(), and WARNING.

Referenced by pgpa_planner_shutdown().

◆ pgpa_planner_install_hooks()

void pgpa_planner_install_hooks ( void  )
extern

Definition at line 181 of file pgpa_planner.c.

182{
194}
int GetPlannerExtensionId(const char *extension_name)
Definition extendplan.c:41
join_path_setup_hook_type join_path_setup_hook
Definition joinpath.c:32
static void pgpa_planner_shutdown(PlannerGlobal *glob, Query *parse, const char *query_string, PlannedStmt *pstmt)
static planner_setup_hook_type prev_planner_setup
static joinrel_setup_hook_type prev_joinrel_setup
static build_simple_rel_hook_type prev_build_simple_rel
static void pgpa_build_simple_rel(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte)
static void pgpa_planner_setup(PlannerGlobal *glob, Query *parse, const char *query_string, int cursorOptions, double *tuple_fraction, ExplainState *es)
static planner_shutdown_hook_type prev_planner_shutdown
static int planner_extension_id
static void pgpa_join_path_setup(PlannerInfo *root, RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel, JoinType jointype, JoinPathExtraData *extra)
static void pgpa_joinrel_setup(PlannerInfo *root, RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel, SpecialJoinInfo *sjinfo, List *restrictlist)
static join_path_setup_hook_type prev_join_path_setup
planner_shutdown_hook_type planner_shutdown_hook
Definition planner.c:80
planner_setup_hook_type planner_setup_hook
Definition planner.c:77
joinrel_setup_hook_type joinrel_setup_hook
Definition relnode.c:54
build_simple_rel_hook_type build_simple_rel_hook
Definition relnode.c:51

References build_simple_rel_hook, GetPlannerExtensionId(), join_path_setup_hook, joinrel_setup_hook, pgpa_build_simple_rel(), pgpa_join_path_setup(), pgpa_joinrel_setup(), pgpa_planner_setup(), pgpa_planner_shutdown(), planner_extension_id, planner_setup_hook, planner_shutdown_hook, prev_build_simple_rel, prev_join_path_setup, prev_joinrel_setup, prev_planner_setup, and prev_planner_shutdown.

Referenced by _PG_init().

Variable Documentation

◆ pgpa_planner_generate_advice

int pgpa_planner_generate_advice
extern

Definition at line 97 of file pgpa_planner.c.

Referenced by pg_plan_advice_request_advice_generation(), and pgpa_planner_setup().