↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Documentation / Extension Hooks / Query planning

set_join_pathlist_hook

set_join_pathlist_hook

Hook for plugins to get control in add_paths_to_joinrel()

Reading PostgreSQL 18.

Description

Hook for plugins to get control in add_paths_to_joinrel()

Interface type
set_join_pathlist_hook_type
Header
src/include/optimizer/paths.h
Subsystem
Query planning
Initial value
NULL (no hook installed)

C interface

typedef void (*set_join_pathlist_hook_type) (PlannerInfo *root, RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel, JoinType jointype, JoinPathExtraData *extra);
extern PGDLLIMPORT set_join_pathlist_hook_type set_join_pathlist_hook;

Core source comments

6. Finally, give extensions a chance to manipulate the path list. They could add new paths (such as CustomPaths) by calling add_path(), or add_partial_path() if parallel aware. They could also delete or modify paths added by the core code.

Call sites

src/backend/optimizer/path/joinpath.c:343

Core call context: src/backend/optimizer/path/joinpath.c:337–351

	 * 6. Finally, give extensions a chance to manipulate the path list.  They
	 * could add new paths (such as CustomPaths) by calling add_path(), or
	 * add_partial_path() if parallel aware.  They could also delete or modify
	 * paths added by the core code.
	 */
	if (set_join_pathlist_hook)
		set_join_pathlist_hook(root, joinrel, outerrel, innerrel,
							   jointype, &extra);
}

/*
 * We override the param_source_rels heuristic to accept nestloop paths in
 * which the outer rel satisfies some but not all of the inner path's
 * parameterization.  This is necessary to get good plans for star-schema
 * scenarios, in which a parameterized path for a large table may require

Related entries

Documentation and source

Source build
Version
18
Build
REL_18_STABLE
Source fingerprint
753057e340da8f22e57c9a409ea7a235fd6a46bd

Related entries

Back to Extension Hooks · Recorded in PostgreSQL 10 through 20; the first sample is not necessarily its introduction.