{"Entry":{"collection":"hook","key":"joinrel_setup_hook","name":"joinrel_setup_hook","aliases":[],"metadata":{"aliases":[],"category":"Query planning","content_hash":"1440c361e077d36e0d403d962fbe6c744b9af31963b265a1c6309b54892d554d","imported_at":"2026-09-27T17:57:58.879309+08:00","name":"joinrel_setup_hook","name_zh":"joinrel_setup_hook","slug":"joinrel_setup_hook","summary":"Hook for plugins to get control during joinrel setup"}},"Definition":{"Collection":"hook","Key":"joinrel_setup_hook","SourceDatabase":"center","Version":"20","SourceTable":"hook","SourceKey":"joinrel_setup_hook","SourceRevision":"2c10c2ce4d7bcd57543a49ab402af02a39724e0a","Facts":{"description":["Hook for plugins to get control during joinrel setup"],"facts":[{"label":"Interface type","value":"joinrel_setup_hook_type"},{"label":"Header","value":"src/include/optimizer/pathnode.h"},{"label":"Subsystem","value":"Query planning"},{"label":"Initial value","value":"NULL (no hook installed)"}],"related":[{"label":"The Planner/Optimizer","url":"/docs/devel/planner-optimizer.html"}],"release":{"channel":"devel","label":"20 devel","major":"20","ref":"master","revision":"2c10c2ce4d7bcd57543a49ab402af02a39724e0a"},"sections":[{"paragraphs":["Allow a plugin to editorialize on the new joinrel's properties. Actions might include altering the size estimate, clearing consider_parallel, or adjusting pgs_mask.","Allow a plugin to editorialize on the new joinrel's properties. Actions might include altering the size estimate, clearing consider_parallel, or adjusting pgs_mask. (However, note that clearing consider_parallel would be better done in the parent joinrel rather than here.)"],"title":"Core source comments"},{"paragraphs":["src/backend/optimizer/util/relnode.c:1012","src/backend/optimizer/util/relnode.c:1173"],"title":"Call sites"},{"code":"\t/*\n\t * Allow a plugin to editorialize on the new joinrel's properties. Actions\n\t * might include altering the size estimate, clearing consider_parallel,\n\t * or adjusting pgs_mask.\n\t */\n\tif (joinrel_setup_hook)\n\t\t(*joinrel_setup_hook) (root, joinrel, outer_rel, inner_rel, sjinfo,\n\t\t\t\t\t\t\t   restrictlist);\n\n\t/* Store the partition information. */\n\tbuild_joinrel_partition_info(root, joinrel, outer_rel, inner_rel, sjinfo,\n\t\t\t\t\t\t\t\t restrictlist);\n\n\t/* Add the joinrel to the PlannerInfo. */\n\tadd_join_rel(root, joinrel);","paragraphs":[],"title":"Core call context: src/backend/optimizer/util/relnode.c:1006–1020"},{"code":"\t * Allow a plugin to editorialize on the new joinrel's properties. Actions\n\t * might include altering the size estimate, clearing consider_parallel,\n\t * or adjusting pgs_mask. (However, note that clearing consider_parallel\n\t * would be better done in the parent joinrel rather than here.)\n\t */\n\tif (joinrel_setup_hook)\n\t\t(*joinrel_setup_hook) (root, joinrel, outer_rel, inner_rel, sjinfo,\n\t\t\t\t\t\t\t   restrictlist);\n\n\t/* Is the join between partitions itself partitioned? */\n\tbuild_joinrel_partition_info(root, joinrel, outer_rel, inner_rel, sjinfo,\n\t\t\t\t\t\t\t\t restrictlist);\n\n\t/* We build the join only once. */\n\tAssert(!find_join_rel(root, joinrel-\u003erelids));","paragraphs":[],"title":"Core call context: src/backend/optimizer/util/relnode.c:1167–1181"}],"signature":"typedef void (*joinrel_setup_hook_type) (PlannerInfo *root, RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel, SpecialJoinInfo *sjinfo, List *restrictlist);\nextern PGDLLIMPORT joinrel_setup_hook_type joinrel_setup_hook;","sources":[{"label":"Interface declaration","path":"src/include/optimizer/pathnode.h","sha256":"7f5594bdaa1a3cd656ab9a8174fc3ba3d1b25ddf79773e5f8063b939413d1fd9","url":"https://github.com/postgres/postgres/blob/2c10c2ce4d7bcd57543a49ab402af02a39724e0a/src/include/optimizer/pathnode.h#L42"},{"label":"Core definition","path":"src/backend/optimizer/util/relnode.c","sha256":"e4d52530d522808857981ecf0b5943d10844732c06f18a4e4b2323afbd58b67d","url":"https://github.com/postgres/postgres/blob/2c10c2ce4d7bcd57543a49ab402af02a39724e0a/src/backend/optimizer/util/relnode.c#L54"},{"label":"Call sites","path":"src/backend/optimizer/util/relnode.c","sha256":"e4d52530d522808857981ecf0b5943d10844732c06f18a4e4b2323afbd58b67d","url":"https://github.com/postgres/postgres/blob/2c10c2ce4d7bcd57543a49ab402af02a39724e0a/src/backend/optimizer/util/relnode.c#L1012"}]},"ManualEvidence":{"release":{"channel":"devel","label":"20 devel","major":"20","ref":"master","revision":"2c10c2ce4d7bcd57543a49ab402af02a39724e0a"},"sources":[{"label":"Interface declaration","path":"src/include/optimizer/pathnode.h","sha256":"7f5594bdaa1a3cd656ab9a8174fc3ba3d1b25ddf79773e5f8063b939413d1fd9","url":"https://github.com/postgres/postgres/blob/2c10c2ce4d7bcd57543a49ab402af02a39724e0a/src/include/optimizer/pathnode.h#L42"},{"label":"Core definition","path":"src/backend/optimizer/util/relnode.c","sha256":"e4d52530d522808857981ecf0b5943d10844732c06f18a4e4b2323afbd58b67d","url":"https://github.com/postgres/postgres/blob/2c10c2ce4d7bcd57543a49ab402af02a39724e0a/src/backend/optimizer/util/relnode.c#L54"},{"label":"Call sites","path":"src/backend/optimizer/util/relnode.c","sha256":"e4d52530d522808857981ecf0b5943d10844732c06f18a4e4b2323afbd58b67d","url":"https://github.com/postgres/postgres/blob/2c10c2ce4d7bcd57543a49ab402af02a39724e0a/src/backend/optimizer/util/relnode.c#L1012"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"joinrel_setup_hook","SourceDatabase":"center","Version":"20","Locale":"en","Title":"joinrel_setup_hook","Summary":"Hook for plugins to get control during joinrel setup","BodyHTML":"\u003cp\u003eHook for plugins to get control during joinrel setup\u003c/p\u003e","SourceRevision":"2c10c2ce4d7bcd57543a49ab402af02a39724e0a","ContentHash":"6faf69a4d59d199b44e16f75f9a7ae211bc8a853226650072f35733935e6067f","Payload":{"description":["Hook for plugins to get control during joinrel setup"],"related":[{"label":"The Planner/Optimizer","url":"/docs/devel/planner-optimizer.html"}],"sections":[{"paragraphs":["Allow a plugin to editorialize on the new joinrel's properties. Actions might include altering the size estimate, clearing consider_parallel, or adjusting pgs_mask.","Allow a plugin to editorialize on the new joinrel's properties. Actions might include altering the size estimate, clearing consider_parallel, or adjusting pgs_mask. (However, note that clearing consider_parallel would be better done in the parent joinrel rather than here.)"],"title":"Core source comments"},{"paragraphs":["src/backend/optimizer/util/relnode.c:1012","src/backend/optimizer/util/relnode.c:1173"],"title":"Call sites"},{"code":"\t/*\n\t * Allow a plugin to editorialize on the new joinrel's properties. Actions\n\t * might include altering the size estimate, clearing consider_parallel,\n\t * or adjusting pgs_mask.\n\t */\n\tif (joinrel_setup_hook)\n\t\t(*joinrel_setup_hook) (root, joinrel, outer_rel, inner_rel, sjinfo,\n\t\t\t\t\t\t\t   restrictlist);\n\n\t/* Store the partition information. */\n\tbuild_joinrel_partition_info(root, joinrel, outer_rel, inner_rel, sjinfo,\n\t\t\t\t\t\t\t\t restrictlist);\n\n\t/* Add the joinrel to the PlannerInfo. */\n\tadd_join_rel(root, joinrel);","paragraphs":[],"title":"Core call context: src/backend/optimizer/util/relnode.c:1006–1020"},{"code":"\t * Allow a plugin to editorialize on the new joinrel's properties. Actions\n\t * might include altering the size estimate, clearing consider_parallel,\n\t * or adjusting pgs_mask. (However, note that clearing consider_parallel\n\t * would be better done in the parent joinrel rather than here.)\n\t */\n\tif (joinrel_setup_hook)\n\t\t(*joinrel_setup_hook) (root, joinrel, outer_rel, inner_rel, sjinfo,\n\t\t\t\t\t\t\t   restrictlist);\n\n\t/* Is the join between partitions itself partitioned? */\n\tbuild_joinrel_partition_info(root, joinrel, outer_rel, inner_rel, sjinfo,\n\t\t\t\t\t\t\t\t restrictlist);\n\n\t/* We build the join only once. */\n\tAssert(!find_join_rel(root, joinrel-\u003erelids));","paragraphs":[],"title":"Core call context: src/backend/optimizer/util/relnode.c:1167–1181"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
