↑↓ select ↵ open ⌫ change scope Open full search

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

Documentation / Extension Hooks / Query planning

join_search_hook

join_search_hook

Hook for plugins to replace standard_join_search()

Reading PostgreSQL 18.

Description

Hook for plugins to replace standard_join_search()

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

C interface

typedef RelOptInfo *(*join_search_hook_type) (PlannerInfo *root, int levels_needed, List *initial_rels);
extern PGDLLIMPORT join_search_hook_type join_search_hook;

Call sites

src/backend/optimizer/path/allpaths.c:3423

Core call context: src/backend/optimizer/path/allpaths.c:3417–3431

		 * We put the initial_rels list into a PlannerInfo field because
		 * has_legal_joinclause() needs to look at it (ugly :-().
		 */
		root->initial_rels = initial_rels;

		if (join_search_hook)
			return (*join_search_hook) (root, levels_needed, initial_rels);
		else if (enable_geqo && levels_needed >= geqo_threshold)
			return geqo(root, levels_needed, initial_rels);
		else
			return standard_join_search(root, levels_needed, initial_rels);
	}
}

/*

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.