|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "pg_plan_advice.h"#include "pgpa_ast.h"#include "pgpa_identifier.h"#include "pgpa_output.h"#include "pgpa_planner.h"#include "pgpa_trove.h"#include "pgpa_walker.h"#include "commands/defrem.h"#include "commands/explain.h"#include "commands/explain_format.h"#include "commands/explain_state.h"#include "funcapi.h"#include "optimizer/planner.h"#include "storage/dsm_registry.h"#include "utils/guc.h"
Go to the source code of this file.
Definition at line 65 of file pg_plan_advice.c.
References DefineCustomBoolVariable(), DefineCustomStringVariable(), es_extension_id, explain_per_plan_hook, fb(), GetExplainExtensionId(), MarkGUCPrefixReserved(), pg_plan_advice_advice, pg_plan_advice_advice_check_hook(), pg_plan_advice_always_explain_supplied_advice, pg_plan_advice_always_store_advice_details, pg_plan_advice_explain_option_handler(), pg_plan_advice_explain_per_plan_hook(), pg_plan_advice_feedback_warnings, pg_plan_advice_trace_mask, PGC_USERSET, pgpa_planner_install_hooks(), prev_explain_per_plan, and RegisterExtensionExplainOption().
Definition at line 447 of file pg_plan_advice.c.
References fb(), and foreach_node.
Referenced by pg_plan_advice_explain_per_plan_hook().
| void pg_plan_advice_add_advisor | ( | pg_plan_advice_advisor_hook | hook | ) |
Definition at line 204 of file pg_plan_advice.c.
References advisor_hook_list, lappend(), MemoryContextSwitchTo(), and pg_plan_advice_get_mcxt().
|
static |
Definition at line 412 of file pg_plan_advice.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, CurrentMemoryContext, error(), fb(), GUC_check_errdetail, MemoryContextDelete(), MemoryContextSwitchTo(), newval, and pgpa_parse().
Referenced by _PG_init().
|
static |
Definition at line 321 of file pg_plan_advice.c.
References appendStringInfo(), buf, defGetInt32(), fb(), foreach_node, initStringInfo(), pg_plan_advice_explain_text_multiline(), and pgpa_trove_append_flags().
Referenced by pg_plan_advice_explain_per_plan_hook().
|
static |
Definition at line 256 of file pg_plan_advice.c.
References defGetBoolean(), es_extension_id, fb(), GetExplainExtensionState(), palloc0_object, and SetExplainExtensionState().
Referenced by _PG_init().
|
static |
Definition at line 343 of file pg_plan_advice.c.
References PlannedStmt::extension_state, fb(), find_defelem_by_defname(), pg_plan_advice_always_explain_supplied_advice, pg_plan_advice_explain_feedback(), pg_plan_advice_explain_text_multiline(), pg_plan_advice_should_explain(), prev_explain_per_plan, and strVal.
Referenced by _PG_init().
|
static |
Definition at line 277 of file pg_plan_advice.c.
References appendBinaryStringInfo(), appendStringInfo(), EXPLAIN_FORMAT_TEXT, ExplainIndentText(), ExplainPropertyText(), fb(), ExplainState::format, ExplainState::indent, ExplainState::str, and value.
Referenced by pg_plan_advice_explain_feedback(), and pg_plan_advice_explain_per_plan_hook().
| MemoryContext pg_plan_advice_get_mcxt | ( | void | ) |
Definition at line 142 of file pg_plan_advice.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, fb(), pgpa_memory_context, and TopMemoryContext.
Referenced by pg_plan_advice_add_advisor(), and pg_plan_advice_remove_advisor().
| char * pg_plan_advice_get_supplied_query_advice | ( | PlannerGlobal * | glob, |
| Query * | parse, | ||
| const char * | query_string, | ||
| int | cursorOptions, | ||
| ExplainState * | es | ||
| ) |
Definition at line 169 of file pg_plan_advice.c.
References advisor_hook_list, fb(), lfirst, parse(), and pg_plan_advice_advice.
Referenced by pgpa_planner_setup().
| void pg_plan_advice_remove_advisor | ( | pg_plan_advice_advisor_hook | hook | ) |
Definition at line 217 of file pg_plan_advice.c.
References advisor_hook_list, list_delete_ptr(), MemoryContextSwitchTo(), and pg_plan_advice_get_mcxt().
Definition at line 241 of file pg_plan_advice.c.
References Assert, fb(), and pgpa_planner_generate_advice.
| bool pg_plan_advice_should_explain | ( | ExplainState * | es | ) |
Definition at line 156 of file pg_plan_advice.c.
References es_extension_id, fb(), and GetExplainExtensionState().
Referenced by pg_plan_advice_explain_per_plan_hook(), and pgpa_planner_setup().
Definition at line 46 of file pg_plan_advice.c.
Referenced by pg_plan_advice_add_advisor(), pg_plan_advice_get_supplied_query_advice(), and pg_plan_advice_remove_advisor().
|
static |
Definition at line 44 of file pg_plan_advice.c.
Referenced by _PG_init(), pg_plan_advice_explain_option_handler(), and pg_plan_advice_should_explain().
| PG_MODULE_MAGIC |
Definition at line 31 of file pg_plan_advice.c.
Definition at line 34 of file pg_plan_advice.c.
Referenced by _PG_init(), and pg_plan_advice_get_supplied_query_advice().
Definition at line 36 of file pg_plan_advice.c.
Referenced by _PG_init(), and pg_plan_advice_explain_per_plan_hook().
Definition at line 35 of file pg_plan_advice.c.
Referenced by _PG_init(), and pgpa_planner_setup().
Definition at line 37 of file pg_plan_advice.c.
Referenced by _PG_init(), pgpa_planner_setup(), and pgpa_planner_shutdown().
Definition at line 38 of file pg_plan_advice.c.
Referenced by _PG_init(), pgpa_build_simple_rel(), pgpa_join_path_setup(), and pgpa_joinrel_setup().
|
static |
Definition at line 45 of file pg_plan_advice.c.
Referenced by pg_plan_advice_get_mcxt().
|
static |
Definition at line 41 of file pg_plan_advice.c.
Referenced by _PG_init(), and pg_plan_advice_explain_per_plan_hook().