{"Entry":{"collection":"hook","key":"build_simple_rel_hook","name":"build_simple_rel_hook","aliases":[],"metadata":{"aliases":[],"category":"Query planning","content_hash":"95bc6a6f6a9539741e7d1de6762f0ba017defc28323247c5fdf46b5cad350be7","imported_at":"2026-09-27T17:57:58.868297+08:00","name":"build_simple_rel_hook","name_zh":"build_simple_rel_hook","slug":"build_simple_rel_hook","summary":"Hook for plugins to get control in build_simple_rel()"}},"Definition":{"Collection":"hook","Key":"build_simple_rel_hook","SourceDatabase":"center","Version":"20","SourceTable":"hook","SourceKey":"build_simple_rel_hook","SourceRevision":"2c10c2ce4d7bcd57543a49ab402af02a39724e0a","Facts":{"description":["Hook for plugins to get control in build_simple_rel()"],"facts":[{"label":"Interface type","value":"build_simple_rel_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 RelOptInfo. This could involve editorializing on the information which get_relation_info obtained from the catalogs, such as altering the assumed relation size, removing an index, or adding a hypothetical index to the indexlist. An extension can also modify rel-\u003epgs_mask here to control path generation."],"title":"Core source comments"},{"paragraphs":["src/backend/optimizer/util/relnode.c:413"],"title":"Call sites"},{"code":"\t * removing an index, or adding a hypothetical index to the indexlist.\n\t *\n\t * An extension can also modify rel-\u003epgs_mask here to control path\n\t * generation.\n\t */\n\tif (build_simple_rel_hook)\n\t\t(*build_simple_rel_hook) (root, rel, rte);\n\n\t/*\n\t * Apply the parent's quals to the child, with appropriate substitution of\n\t * variables.  If any resulting clause is reduced to constant FALSE or\n\t * NULL, apply_child_basequals returns false to indicate that scanning\n\t * this relation won't yield any rows.  In this case, we mark the child as\n\t * dummy right away.  (We must do this immediately so that pruning works\n\t * correctly when recursing in expand_partitioned_rtentry.)","paragraphs":[],"title":"Core call context: src/backend/optimizer/util/relnode.c:407–421"}],"signature":"typedef void (*build_simple_rel_hook_type) (PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte);\nextern PGDLLIMPORT build_simple_rel_hook_type build_simple_rel_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#L21"},{"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#L51"},{"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#L413"}]},"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#L21"},{"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#L51"},{"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#L413"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"build_simple_rel_hook","SourceDatabase":"center","Version":"20","Locale":"en","Title":"build_simple_rel_hook","Summary":"Hook for plugins to get control in build_simple_rel()","BodyHTML":"\u003cp\u003eHook for plugins to get control in build_simple_rel()\u003c/p\u003e","SourceRevision":"2c10c2ce4d7bcd57543a49ab402af02a39724e0a","ContentHash":"cbc93e5ec55036408f00f8134d32acceb24c484e0464dd3af892359644112019","Payload":{"description":["Hook for plugins to get control in build_simple_rel()"],"related":[{"label":"The Planner/Optimizer","url":"/docs/devel/planner-optimizer.html"}],"sections":[{"paragraphs":["Allow a plugin to editorialize on the new RelOptInfo. This could involve editorializing on the information which get_relation_info obtained from the catalogs, such as altering the assumed relation size, removing an index, or adding a hypothetical index to the indexlist. An extension can also modify rel-\u003epgs_mask here to control path generation."],"title":"Core source comments"},{"paragraphs":["src/backend/optimizer/util/relnode.c:413"],"title":"Call sites"},{"code":"\t * removing an index, or adding a hypothetical index to the indexlist.\n\t *\n\t * An extension can also modify rel-\u003epgs_mask here to control path\n\t * generation.\n\t */\n\tif (build_simple_rel_hook)\n\t\t(*build_simple_rel_hook) (root, rel, rte);\n\n\t/*\n\t * Apply the parent's quals to the child, with appropriate substitution of\n\t * variables.  If any resulting clause is reduced to constant FALSE or\n\t * NULL, apply_child_basequals returns false to indicate that scanning\n\t * this relation won't yield any rows.  In this case, we mark the child as\n\t * dummy right away.  (We must do this immediately so that pruning works\n\t * correctly when recursing in expand_partitioned_rtentry.)","paragraphs":[],"title":"Core call context: src/backend/optimizer/util/relnode.c:407–421"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
