{"kind": "hook", "major": "18", "item": {"slug": "get_relation_stats_hook", "name": "get_relation_stats_hook", "name_zh": "get_relation_stats_hook", "category": "Statistics and estimation", "summary": "Hooks for plugins to get control when we ask for stats", "aliases": [], "versions": {"10": {"facts": [{"label": "Interface type", "value": "get_relation_stats_hook_type"}, {"label": "Header", "value": "src/include/utils/selfuncs.h"}, {"label": "Subsystem", "value": "Statistics and estimation"}, {"label": "Initial value", "value": "NULL (no hook installed)"}], "related": [{"url": "/docs/10/planner-optimizer.html", "label": "The Planner/Optimizer"}], "release": {"ref": "REL_10_STABLE", "label": "10", "major": "10", "channel": "historical", "revision": "f4e8f137bfb08a664c8288824c1e36b5143ac875"}, "sources": [{"url": "https://github.com/postgres/postgres/blob/f4e8f137bfb08a664c8288824c1e36b5143ac875/src/include/utils/selfuncs.h#L142", "path": "src/include/utils/selfuncs.h", "label": "Interface declaration", "sha256": "6403861cc3a1cbe440f954519c911414d5b18530fda92c6e2ef8612075e74b30"}, {"url": "https://github.com/postgres/postgres/blob/f4e8f137bfb08a664c8288824c1e36b5143ac875/src/backend/utils/adt/selfuncs.c#L155", "path": "src/backend/utils/adt/selfuncs.c", "label": "Core definition", "sha256": "288b5af493935cc76448085b2bdc43b5334a3b8eb2e30837135a4849d77c4c7b"}, {"url": "https://github.com/postgres/postgres/blob/f4e8f137bfb08a664c8288824c1e36b5143ac875/src/backend/utils/adt/selfuncs.c#L4864", "path": "src/backend/utils/adt/selfuncs.c", "label": "Call sites", "sha256": "288b5af493935cc76448085b2bdc43b5334a3b8eb2e30837135a4849d77c4c7b"}], "sections": [{"title": "Call sites", "paragraphs": ["src/backend/utils/adt/selfuncs.c:4864", "src/backend/utils/adt/selfuncs.c:7028", "src/backend/utils/adt/selfuncs.c:7981"]}, {"code": "{\n\tRangeTblEntry *rte = root->simple_rte_array[var->varno];\n\n\tAssert(IsA(rte, RangeTblEntry));\n\n\tif (get_relation_stats_hook &&\n\t\t(*get_relation_stats_hook) (root, rte, var->varattno, vardata))\n\t{\n\t\t/*\n\t\t * The hook took control of acquiring a stats tuple.  If it did supply\n\t\t * a tuple, it'd better have supplied a freefunc.\n\t\t */\n\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t!vardata->freefunc)\n\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:4858\u20134872", "paragraphs": []}, {"code": "\t\tAssert(rte->rtekind == RTE_RELATION);\n\t\trelid = rte->relid;\n\t\tAssert(relid != InvalidOid);\n\t\tcolnum = index->indexkeys[0];\n\n\t\tif (get_relation_stats_hook &&\n\t\t\t(*get_relation_stats_hook) (root, rte, colnum, &vardata))\n\t\t{\n\t\t\t/*\n\t\t\t * The hook took control of acquiring a stats tuple.  If it did\n\t\t\t * supply a tuple, it'd better have supplied a freefunc.\n\t\t\t */\n\t\t\tif (HeapTupleIsValid(vardata.statsTuple) &&\n\t\t\t\t!vardata.freefunc)\n\t\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:7022\u20137036", "paragraphs": []}, {"code": "\n\t\t/* attempt to lookup stats in relation for this index column */\n\t\tif (attnum != 0)\n\t\t{\n\t\t\t/* Simple variable -- look to stats for the underlying table */\n\t\t\tif (get_relation_stats_hook &&\n\t\t\t\t(*get_relation_stats_hook) (root, rte, attnum, &vardata))\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * The hook took control of acquiring a stats tuple.  If it\n\t\t\t\t * did supply a tuple, it'd better have supplied a freefunc.\n\t\t\t\t */\n\t\t\t\tif (HeapTupleIsValid(vardata.statsTuple) && !vardata.freefunc)\n\t\t\t\t\telog(ERROR,\n\t\t\t\t\t\t \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:7975\u20137989", "paragraphs": []}], "signature": "typedef bool (*get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata);\nextern PGDLLIMPORT get_relation_stats_hook_type get_relation_stats_hook;", "description": ["Hooks for plugins to get control when we ask for stats"]}, "11": {"facts": [{"label": "Interface type", "value": "get_relation_stats_hook_type"}, {"label": "Header", "value": "src/include/utils/selfuncs.h"}, {"label": "Subsystem", "value": "Statistics and estimation"}, {"label": "Initial value", "value": "NULL (no hook installed)"}], "related": [{"url": "/docs/11/planner-optimizer.html", "label": "The Planner/Optimizer"}], "release": {"ref": "REL_11_STABLE", "label": "11", "major": "11", "channel": "historical", "revision": "170e416034ec0231d9e9238f2577eeb76ca8d181"}, "sources": [{"url": "https://github.com/postgres/postgres/blob/170e416034ec0231d9e9238f2577eeb76ca8d181/src/include/utils/selfuncs.h#L145", "path": "src/include/utils/selfuncs.h", "label": "Interface declaration", "sha256": "05b41241a0d7e6703407878eaf1a9ac5b2ca6387143c217533396f0dd05d41e7"}, {"url": "https://github.com/postgres/postgres/blob/170e416034ec0231d9e9238f2577eeb76ca8d181/src/backend/utils/adt/selfuncs.c#L158", "path": "src/backend/utils/adt/selfuncs.c", "label": "Core definition", "sha256": "8992cb024b68aabbb92e21703fb76efc266c9a79207430b1b7b7f0aaa59d3f18"}, {"url": "https://github.com/postgres/postgres/blob/170e416034ec0231d9e9238f2577eeb76ca8d181/src/backend/utils/adt/selfuncs.c#L5089", "path": "src/backend/utils/adt/selfuncs.c", "label": "Call sites", "sha256": "8992cb024b68aabbb92e21703fb76efc266c9a79207430b1b7b7f0aaa59d3f18"}], "sections": [{"title": "Call sites", "paragraphs": ["src/backend/utils/adt/selfuncs.c:5089", "src/backend/utils/adt/selfuncs.c:7458", "src/backend/utils/adt/selfuncs.c:8413"]}, {"code": "{\n\tRangeTblEntry *rte = root->simple_rte_array[var->varno];\n\n\tAssert(IsA(rte, RangeTblEntry));\n\n\tif (get_relation_stats_hook &&\n\t\t(*get_relation_stats_hook) (root, rte, var->varattno, vardata))\n\t{\n\t\t/*\n\t\t * The hook took control of acquiring a stats tuple.  If it did supply\n\t\t * a tuple, it'd better have supplied a freefunc.\n\t\t */\n\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t!vardata->freefunc)\n\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:5083\u20135097", "paragraphs": []}, {"code": "\t\tAssert(rte->rtekind == RTE_RELATION);\n\t\trelid = rte->relid;\n\t\tAssert(relid != InvalidOid);\n\t\tcolnum = index->indexkeys[0];\n\n\t\tif (get_relation_stats_hook &&\n\t\t\t(*get_relation_stats_hook) (root, rte, colnum, &vardata))\n\t\t{\n\t\t\t/*\n\t\t\t * The hook took control of acquiring a stats tuple.  If it did\n\t\t\t * supply a tuple, it'd better have supplied a freefunc.\n\t\t\t */\n\t\t\tif (HeapTupleIsValid(vardata.statsTuple) &&\n\t\t\t\t!vardata.freefunc)\n\t\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:7452\u20137466", "paragraphs": []}, {"code": "\n\t\t/* attempt to lookup stats in relation for this index column */\n\t\tif (attnum != 0)\n\t\t{\n\t\t\t/* Simple variable -- look to stats for the underlying table */\n\t\t\tif (get_relation_stats_hook &&\n\t\t\t\t(*get_relation_stats_hook) (root, rte, attnum, &vardata))\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * The hook took control of acquiring a stats tuple.  If it\n\t\t\t\t * did supply a tuple, it'd better have supplied a freefunc.\n\t\t\t\t */\n\t\t\t\tif (HeapTupleIsValid(vardata.statsTuple) && !vardata.freefunc)\n\t\t\t\t\telog(ERROR,\n\t\t\t\t\t\t \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:8407\u20138421", "paragraphs": []}], "signature": "typedef bool (*get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata);\nextern PGDLLIMPORT get_relation_stats_hook_type get_relation_stats_hook;", "description": ["Hooks for plugins to get control when we ask for stats"]}, "12": {"facts": [{"label": "Interface type", "value": "get_relation_stats_hook_type"}, {"label": "Header", "value": "src/include/utils/selfuncs.h"}, {"label": "Subsystem", "value": "Statistics and estimation"}, {"label": "Initial value", "value": "NULL (no hook installed)"}], "related": [{"url": "/docs/12/planner-optimizer.html", "label": "The Planner/Optimizer"}], "release": {"ref": "REL_12_STABLE", "label": "12", "major": "12", "channel": "historical", "revision": "3f302f0ed06f69c5ebd33d4df95895323a3cbef6"}, "sources": [{"url": "https://github.com/postgres/postgres/blob/3f302f0ed06f69c5ebd33d4df95895323a3cbef6/src/include/utils/selfuncs.h#L116", "path": "src/include/utils/selfuncs.h", "label": "Interface declaration", "sha256": "4ee9dbdb6d7ce67221901d190471512285646f7514af6e9a9236437ec78189f2"}, {"url": "https://github.com/postgres/postgres/blob/3f302f0ed06f69c5ebd33d4df95895323a3cbef6/src/backend/utils/adt/selfuncs.c#L147", "path": "src/backend/utils/adt/selfuncs.c", "label": "Core definition", "sha256": "4f7a57fc0766f773a26d2ffdc0fb84927cb8908ddce0e54e6cc8c5e36ab85d16"}, {"url": "https://github.com/postgres/postgres/blob/3f302f0ed06f69c5ebd33d4df95895323a3cbef6/src/backend/utils/adt/selfuncs.c#L4791", "path": "src/backend/utils/adt/selfuncs.c", "label": "Call sites", "sha256": "4f7a57fc0766f773a26d2ffdc0fb84927cb8908ddce0e54e6cc8c5e36ab85d16"}], "sections": [{"title": "Call sites", "paragraphs": ["src/backend/utils/adt/selfuncs.c:4791", "src/backend/utils/adt/selfuncs.c:6280", "src/backend/utils/adt/selfuncs.c:7206"]}, {"code": "{\n\tRangeTblEntry *rte = root->simple_rte_array[var->varno];\n\n\tAssert(IsA(rte, RangeTblEntry));\n\n\tif (get_relation_stats_hook &&\n\t\t(*get_relation_stats_hook) (root, rte, var->varattno, vardata))\n\t{\n\t\t/*\n\t\t * The hook took control of acquiring a stats tuple.  If it did supply\n\t\t * a tuple, it'd better have supplied a freefunc.\n\t\t */\n\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t!vardata->freefunc)\n\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:4785\u20134799", "paragraphs": []}, {"code": "\t\tAssert(rte->rtekind == RTE_RELATION);\n\t\trelid = rte->relid;\n\t\tAssert(relid != InvalidOid);\n\t\tcolnum = index->indexkeys[0];\n\n\t\tif (get_relation_stats_hook &&\n\t\t\t(*get_relation_stats_hook) (root, rte, colnum, &vardata))\n\t\t{\n\t\t\t/*\n\t\t\t * The hook took control of acquiring a stats tuple.  If it did\n\t\t\t * supply a tuple, it'd better have supplied a freefunc.\n\t\t\t */\n\t\t\tif (HeapTupleIsValid(vardata.statsTuple) &&\n\t\t\t\t!vardata.freefunc)\n\t\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:6274\u20136288", "paragraphs": []}, {"code": "\n\t\t/* attempt to lookup stats in relation for this index column */\n\t\tif (attnum != 0)\n\t\t{\n\t\t\t/* Simple variable -- look to stats for the underlying table */\n\t\t\tif (get_relation_stats_hook &&\n\t\t\t\t(*get_relation_stats_hook) (root, rte, attnum, &vardata))\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * The hook took control of acquiring a stats tuple.  If it\n\t\t\t\t * did supply a tuple, it'd better have supplied a freefunc.\n\t\t\t\t */\n\t\t\t\tif (HeapTupleIsValid(vardata.statsTuple) && !vardata.freefunc)\n\t\t\t\t\telog(ERROR,\n\t\t\t\t\t\t \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:7200\u20137214", "paragraphs": []}], "signature": "typedef bool (*get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata);\nextern PGDLLIMPORT get_relation_stats_hook_type get_relation_stats_hook;", "description": ["Hooks for plugins to get control when we ask for stats"]}, "13": {"facts": [{"label": "Interface type", "value": "get_relation_stats_hook_type"}, {"label": "Header", "value": "src/include/utils/selfuncs.h"}, {"label": "Subsystem", "value": "Statistics and estimation"}, {"label": "Initial value", "value": "NULL (no hook installed)"}], "related": [{"url": "/docs/13/planner-optimizer.html", "label": "The Planner/Optimizer"}], "release": {"ref": "REL_13_STABLE", "label": "13", "major": "13", "channel": "historical", "revision": "05f6c9ec2c475fae8fdd56ae40bd01afcf70d1f2"}, "sources": [{"url": "https://github.com/postgres/postgres/blob/05f6c9ec2c475fae8fdd56ae40bd01afcf70d1f2/src/include/utils/selfuncs.h#L121", "path": "src/include/utils/selfuncs.h", "label": "Interface declaration", "sha256": "035afc988c6f8bc39bf547dcbe12ac6e71aaae677f6673f50cc05cea84c7dfed"}, {"url": "https://github.com/postgres/postgres/blob/05f6c9ec2c475fae8fdd56ae40bd01afcf70d1f2/src/backend/utils/adt/selfuncs.c#L148", "path": "src/backend/utils/adt/selfuncs.c", "label": "Core definition", "sha256": "2d1bdf1b438c6167817fc6126837cb45196fe0c54c93dde18fa814b07d9b9370"}, {"url": "https://github.com/postgres/postgres/blob/05f6c9ec2c475fae8fdd56ae40bd01afcf70d1f2/src/backend/utils/adt/selfuncs.c#L4980", "path": "src/backend/utils/adt/selfuncs.c", "label": "Call sites", "sha256": "2d1bdf1b438c6167817fc6126837cb45196fe0c54c93dde18fa814b07d9b9370"}], "sections": [{"title": "Call sites", "paragraphs": ["src/backend/utils/adt/selfuncs.c:4980", "src/backend/utils/adt/selfuncs.c:6603", "src/backend/utils/adt/selfuncs.c:7559"]}, {"code": "{\n\tRangeTblEntry *rte = root->simple_rte_array[var->varno];\n\n\tAssert(IsA(rte, RangeTblEntry));\n\n\tif (get_relation_stats_hook &&\n\t\t(*get_relation_stats_hook) (root, rte, var->varattno, vardata))\n\t{\n\t\t/*\n\t\t * The hook took control of acquiring a stats tuple.  If it did supply\n\t\t * a tuple, it'd better have supplied a freefunc.\n\t\t */\n\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t!vardata->freefunc)\n\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:4974\u20134988", "paragraphs": []}, {"code": "\t\tAssert(rte->rtekind == RTE_RELATION);\n\t\trelid = rte->relid;\n\t\tAssert(relid != InvalidOid);\n\t\tcolnum = index->indexkeys[0];\n\n\t\tif (get_relation_stats_hook &&\n\t\t\t(*get_relation_stats_hook) (root, rte, colnum, &vardata))\n\t\t{\n\t\t\t/*\n\t\t\t * The hook took control of acquiring a stats tuple.  If it did\n\t\t\t * supply a tuple, it'd better have supplied a freefunc.\n\t\t\t */\n\t\t\tif (HeapTupleIsValid(vardata.statsTuple) &&\n\t\t\t\t!vardata.freefunc)\n\t\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:6597\u20136611", "paragraphs": []}, {"code": "\n\t\t/* attempt to lookup stats in relation for this index column */\n\t\tif (attnum != 0)\n\t\t{\n\t\t\t/* Simple variable -- look to stats for the underlying table */\n\t\t\tif (get_relation_stats_hook &&\n\t\t\t\t(*get_relation_stats_hook) (root, rte, attnum, &vardata))\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * The hook took control of acquiring a stats tuple.  If it\n\t\t\t\t * did supply a tuple, it'd better have supplied a freefunc.\n\t\t\t\t */\n\t\t\t\tif (HeapTupleIsValid(vardata.statsTuple) && !vardata.freefunc)\n\t\t\t\t\telog(ERROR,\n\t\t\t\t\t\t \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:7553\u20137567", "paragraphs": []}], "signature": "typedef bool (*get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata);\nextern PGDLLIMPORT get_relation_stats_hook_type get_relation_stats_hook;", "description": ["Hooks for plugins to get control when we ask for stats"]}, "14": {"facts": [{"label": "Interface type", "value": "get_relation_stats_hook_type"}, {"label": "Header", "value": "src/include/utils/selfuncs.h"}, {"label": "Subsystem", "value": "Statistics and estimation"}, {"label": "Initial value", "value": "NULL (no hook installed)"}], "related": [{"url": "/docs/14/planner-optimizer.html", "label": "The Planner/Optimizer"}], "release": {"ref": "REL_14_STABLE", "label": "14", "major": "14", "channel": "stable", "revision": "fba35c7c28a567839faba867db0808564c0a66db"}, "sources": [{"url": "https://github.com/postgres/postgres/blob/fba35c7c28a567839faba867db0808564c0a66db/src/include/utils/selfuncs.h#L138", "path": "src/include/utils/selfuncs.h", "label": "Interface declaration", "sha256": "477ef6ccc43c3148b49e8209b03d40253a7c433e90503633b8ed2faa7215494a"}, {"url": "https://github.com/postgres/postgres/blob/fba35c7c28a567839faba867db0808564c0a66db/src/backend/utils/adt/selfuncs.c#L144", "path": "src/backend/utils/adt/selfuncs.c", "label": "Core definition", "sha256": "c5e40038ae375f6162564473ff69520d53b19144d2aa966099f645967ef28886"}, {"url": "https://github.com/postgres/postgres/blob/fba35c7c28a567839faba867db0808564c0a66db/src/backend/utils/adt/selfuncs.c#L5297", "path": "src/backend/utils/adt/selfuncs.c", "label": "Call sites", "sha256": "c5e40038ae375f6162564473ff69520d53b19144d2aa966099f645967ef28886"}], "sections": [{"title": "Call sites", "paragraphs": ["src/backend/utils/adt/selfuncs.c:5297", "src/backend/utils/adt/selfuncs.c:6922", "src/backend/utils/adt/selfuncs.c:7878"]}, {"code": "{\n\tRangeTblEntry *rte = root->simple_rte_array[var->varno];\n\n\tAssert(IsA(rte, RangeTblEntry));\n\n\tif (get_relation_stats_hook &&\n\t\t(*get_relation_stats_hook) (root, rte, var->varattno, vardata))\n\t{\n\t\t/*\n\t\t * The hook took control of acquiring a stats tuple.  If it did supply\n\t\t * a tuple, it'd better have supplied a freefunc.\n\t\t */\n\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t!vardata->freefunc)\n\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:5291\u20135305", "paragraphs": []}, {"code": "\t\tAssert(rte->rtekind == RTE_RELATION);\n\t\trelid = rte->relid;\n\t\tAssert(relid != InvalidOid);\n\t\tcolnum = index->indexkeys[0];\n\n\t\tif (get_relation_stats_hook &&\n\t\t\t(*get_relation_stats_hook) (root, rte, colnum, &vardata))\n\t\t{\n\t\t\t/*\n\t\t\t * The hook took control of acquiring a stats tuple.  If it did\n\t\t\t * supply a tuple, it'd better have supplied a freefunc.\n\t\t\t */\n\t\t\tif (HeapTupleIsValid(vardata.statsTuple) &&\n\t\t\t\t!vardata.freefunc)\n\t\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:6916\u20136930", "paragraphs": []}, {"code": "\n\t\t/* attempt to lookup stats in relation for this index column */\n\t\tif (attnum != 0)\n\t\t{\n\t\t\t/* Simple variable -- look to stats for the underlying table */\n\t\t\tif (get_relation_stats_hook &&\n\t\t\t\t(*get_relation_stats_hook) (root, rte, attnum, &vardata))\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * The hook took control of acquiring a stats tuple.  If it\n\t\t\t\t * did supply a tuple, it'd better have supplied a freefunc.\n\t\t\t\t */\n\t\t\t\tif (HeapTupleIsValid(vardata.statsTuple) && !vardata.freefunc)\n\t\t\t\t\telog(ERROR,\n\t\t\t\t\t\t \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:7872\u20137886", "paragraphs": []}], "signature": "typedef bool (*get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata);\nextern PGDLLIMPORT get_relation_stats_hook_type get_relation_stats_hook;", "description": ["Hooks for plugins to get control when we ask for stats"]}, "15": {"facts": [{"label": "Interface type", "value": "get_relation_stats_hook_type"}, {"label": "Header", "value": "src/include/utils/selfuncs.h"}, {"label": "Subsystem", "value": "Statistics and estimation"}, {"label": "Initial value", "value": "NULL (no hook installed)"}], "related": [{"url": "/docs/15/planner-optimizer.html", "label": "The Planner/Optimizer"}], "release": {"ref": "REL_15_STABLE", "label": "15", "major": "15", "channel": "stable", "revision": "0351991b8e7c7b64382e2f30ce581a8f276590a6"}, "sources": [{"url": "https://github.com/postgres/postgres/blob/0351991b8e7c7b64382e2f30ce581a8f276590a6/src/include/utils/selfuncs.h#L138", "path": "src/include/utils/selfuncs.h", "label": "Interface declaration", "sha256": "1d508219fd05df7deb661e98b5532cefc7017758ed089babeb219b0e5d95cebd"}, {"url": "https://github.com/postgres/postgres/blob/0351991b8e7c7b64382e2f30ce581a8f276590a6/src/backend/utils/adt/selfuncs.c#L144", "path": "src/backend/utils/adt/selfuncs.c", "label": "Core definition", "sha256": "79162c96bde542572b9415b92420897d493befc88f02e955af3090ab1c76af1d"}, {"url": "https://github.com/postgres/postgres/blob/0351991b8e7c7b64382e2f30ce581a8f276590a6/src/backend/utils/adt/selfuncs.c#L5281", "path": "src/backend/utils/adt/selfuncs.c", "label": "Call sites", "sha256": "79162c96bde542572b9415b92420897d493befc88f02e955af3090ab1c76af1d"}], "sections": [{"title": "Call sites", "paragraphs": ["src/backend/utils/adt/selfuncs.c:5281", "src/backend/utils/adt/selfuncs.c:6906", "src/backend/utils/adt/selfuncs.c:7862"]}, {"code": "{\n\tRangeTblEntry *rte = root->simple_rte_array[var->varno];\n\n\tAssert(IsA(rte, RangeTblEntry));\n\n\tif (get_relation_stats_hook &&\n\t\t(*get_relation_stats_hook) (root, rte, var->varattno, vardata))\n\t{\n\t\t/*\n\t\t * The hook took control of acquiring a stats tuple.  If it did supply\n\t\t * a tuple, it'd better have supplied a freefunc.\n\t\t */\n\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t!vardata->freefunc)\n\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:5275\u20135289", "paragraphs": []}, {"code": "\t\tAssert(rte->rtekind == RTE_RELATION);\n\t\trelid = rte->relid;\n\t\tAssert(relid != InvalidOid);\n\t\tcolnum = index->indexkeys[0];\n\n\t\tif (get_relation_stats_hook &&\n\t\t\t(*get_relation_stats_hook) (root, rte, colnum, &vardata))\n\t\t{\n\t\t\t/*\n\t\t\t * The hook took control of acquiring a stats tuple.  If it did\n\t\t\t * supply a tuple, it'd better have supplied a freefunc.\n\t\t\t */\n\t\t\tif (HeapTupleIsValid(vardata.statsTuple) &&\n\t\t\t\t!vardata.freefunc)\n\t\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:6900\u20136914", "paragraphs": []}, {"code": "\n\t\t/* attempt to lookup stats in relation for this index column */\n\t\tif (attnum != 0)\n\t\t{\n\t\t\t/* Simple variable -- look to stats for the underlying table */\n\t\t\tif (get_relation_stats_hook &&\n\t\t\t\t(*get_relation_stats_hook) (root, rte, attnum, &vardata))\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * The hook took control of acquiring a stats tuple.  If it\n\t\t\t\t * did supply a tuple, it'd better have supplied a freefunc.\n\t\t\t\t */\n\t\t\t\tif (HeapTupleIsValid(vardata.statsTuple) && !vardata.freefunc)\n\t\t\t\t\telog(ERROR,\n\t\t\t\t\t\t \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:7856\u20137870", "paragraphs": []}], "signature": "typedef bool (*get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata);\nextern PGDLLIMPORT get_relation_stats_hook_type get_relation_stats_hook;", "description": ["Hooks for plugins to get control when we ask for stats"]}, "16": {"facts": [{"label": "Interface type", "value": "get_relation_stats_hook_type"}, {"label": "Header", "value": "src/include/utils/selfuncs.h"}, {"label": "Subsystem", "value": "Statistics and estimation"}, {"label": "Initial value", "value": "NULL (no hook installed)"}], "related": [{"url": "/docs/16/planner-optimizer.html", "label": "The Planner/Optimizer"}], "release": {"ref": "REL_16_STABLE", "label": "16", "major": "16", "channel": "stable", "revision": "dcc37b7099a9f3cf2c75167d8dc92e75f96bc1fa"}, "sources": [{"url": "https://github.com/postgres/postgres/blob/dcc37b7099a9f3cf2c75167d8dc92e75f96bc1fa/src/include/utils/selfuncs.h#L138", "path": "src/include/utils/selfuncs.h", "label": "Interface declaration", "sha256": "1d8250535a2393b146598521d0c131233e174e21c62131ed8b904143f460562e"}, {"url": "https://github.com/postgres/postgres/blob/dcc37b7099a9f3cf2c75167d8dc92e75f96bc1fa/src/backend/utils/adt/selfuncs.c#L147", "path": "src/backend/utils/adt/selfuncs.c", "label": "Core definition", "sha256": "9ac1490ef8751522c48415fb630e7b0a1fc32c23e177e01077adc3364a87ee79"}, {"url": "https://github.com/postgres/postgres/blob/dcc37b7099a9f3cf2c75167d8dc92e75f96bc1fa/src/backend/utils/adt/selfuncs.c#L5321", "path": "src/backend/utils/adt/selfuncs.c", "label": "Call sites", "sha256": "9ac1490ef8751522c48415fb630e7b0a1fc32c23e177e01077adc3364a87ee79"}], "sections": [{"title": "Call sites", "paragraphs": ["src/backend/utils/adt/selfuncs.c:5321", "src/backend/utils/adt/selfuncs.c:6951", "src/backend/utils/adt/selfuncs.c:7960"]}, {"code": "{\n\tRangeTblEntry *rte = root->simple_rte_array[var->varno];\n\n\tAssert(IsA(rte, RangeTblEntry));\n\n\tif (get_relation_stats_hook &&\n\t\t(*get_relation_stats_hook) (root, rte, var->varattno, vardata))\n\t{\n\t\t/*\n\t\t * The hook took control of acquiring a stats tuple.  If it did supply\n\t\t * a tuple, it'd better have supplied a freefunc.\n\t\t */\n\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t!vardata->freefunc)\n\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:5315\u20135329", "paragraphs": []}, {"code": "\t\tAssert(rte->rtekind == RTE_RELATION);\n\t\trelid = rte->relid;\n\t\tAssert(relid != InvalidOid);\n\t\tcolnum = index->indexkeys[0];\n\n\t\tif (get_relation_stats_hook &&\n\t\t\t(*get_relation_stats_hook) (root, rte, colnum, &vardata))\n\t\t{\n\t\t\t/*\n\t\t\t * The hook took control of acquiring a stats tuple.  If it did\n\t\t\t * supply a tuple, it'd better have supplied a freefunc.\n\t\t\t */\n\t\t\tif (HeapTupleIsValid(vardata.statsTuple) &&\n\t\t\t\t!vardata.freefunc)\n\t\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:6945\u20136959", "paragraphs": []}, {"code": "\n\t\t/* attempt to lookup stats in relation for this index column */\n\t\tif (attnum != 0)\n\t\t{\n\t\t\t/* Simple variable -- look to stats for the underlying table */\n\t\t\tif (get_relation_stats_hook &&\n\t\t\t\t(*get_relation_stats_hook) (root, rte, attnum, &vardata))\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * The hook took control of acquiring a stats tuple.  If it\n\t\t\t\t * did supply a tuple, it'd better have supplied a freefunc.\n\t\t\t\t */\n\t\t\t\tif (HeapTupleIsValid(vardata.statsTuple) && !vardata.freefunc)\n\t\t\t\t\telog(ERROR,\n\t\t\t\t\t\t \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:7954\u20137968", "paragraphs": []}], "signature": "typedef bool (*get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata);\nextern PGDLLIMPORT get_relation_stats_hook_type get_relation_stats_hook;", "description": ["Hooks for plugins to get control when we ask for stats"]}, "17": {"facts": [{"label": "Interface type", "value": "get_relation_stats_hook_type"}, {"label": "Header", "value": "src/include/utils/selfuncs.h"}, {"label": "Subsystem", "value": "Statistics and estimation"}, {"label": "Initial value", "value": "NULL (no hook installed)"}], "related": [{"url": "/docs/17/planner-optimizer.html", "label": "The Planner/Optimizer"}], "release": {"ref": "REL_17_STABLE", "label": "17", "major": "17", "channel": "stable", "revision": "163288afd32a448244c8df75b3c33181aadd7f20"}, "sources": [{"url": "https://github.com/postgres/postgres/blob/163288afd32a448244c8df75b3c33181aadd7f20/src/include/utils/selfuncs.h#L141", "path": "src/include/utils/selfuncs.h", "label": "Interface declaration", "sha256": "d5e4e27a8f6eb3c1b474e3cc33d4594cdd79c80cf26f184bace66a566f2a0a3b"}, {"url": "https://github.com/postgres/postgres/blob/163288afd32a448244c8df75b3c33181aadd7f20/src/backend/utils/adt/selfuncs.c#L148", "path": "src/backend/utils/adt/selfuncs.c", "label": "Core definition", "sha256": "eff69814693a9b311261a1c9e7b533893baaab52b336d7ac67b2ba822ce1d222"}, {"url": "https://github.com/postgres/postgres/blob/163288afd32a448244c8df75b3c33181aadd7f20/src/backend/utils/adt/selfuncs.c#L5376", "path": "src/backend/utils/adt/selfuncs.c", "label": "Call sites", "sha256": "eff69814693a9b311261a1c9e7b533893baaab52b336d7ac67b2ba822ce1d222"}], "sections": [{"title": "Call sites", "paragraphs": ["src/backend/utils/adt/selfuncs.c:5376", "src/backend/utils/adt/selfuncs.c:7127", "src/backend/utils/adt/selfuncs.c:8136"]}, {"code": "{\n\tRangeTblEntry *rte = root->simple_rte_array[var->varno];\n\n\tAssert(IsA(rte, RangeTblEntry));\n\n\tif (get_relation_stats_hook &&\n\t\t(*get_relation_stats_hook) (root, rte, var->varattno, vardata))\n\t{\n\t\t/*\n\t\t * The hook took control of acquiring a stats tuple.  If it did supply\n\t\t * a tuple, it'd better have supplied a freefunc.\n\t\t */\n\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t!vardata->freefunc)\n\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:5370\u20135384", "paragraphs": []}, {"code": "\t\tAssert(rte->rtekind == RTE_RELATION);\n\t\trelid = rte->relid;\n\t\tAssert(relid != InvalidOid);\n\t\tcolnum = index->indexkeys[0];\n\n\t\tif (get_relation_stats_hook &&\n\t\t\t(*get_relation_stats_hook) (root, rte, colnum, &vardata))\n\t\t{\n\t\t\t/*\n\t\t\t * The hook took control of acquiring a stats tuple.  If it did\n\t\t\t * supply a tuple, it'd better have supplied a freefunc.\n\t\t\t */\n\t\t\tif (HeapTupleIsValid(vardata.statsTuple) &&\n\t\t\t\t!vardata.freefunc)\n\t\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:7121\u20137135", "paragraphs": []}, {"code": "\n\t\t/* attempt to lookup stats in relation for this index column */\n\t\tif (attnum != 0)\n\t\t{\n\t\t\t/* Simple variable -- look to stats for the underlying table */\n\t\t\tif (get_relation_stats_hook &&\n\t\t\t\t(*get_relation_stats_hook) (root, rte, attnum, &vardata))\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * The hook took control of acquiring a stats tuple.  If it\n\t\t\t\t * did supply a tuple, it'd better have supplied a freefunc.\n\t\t\t\t */\n\t\t\t\tif (HeapTupleIsValid(vardata.statsTuple) && !vardata.freefunc)\n\t\t\t\t\telog(ERROR,\n\t\t\t\t\t\t \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:8130\u20138144", "paragraphs": []}], "signature": "typedef bool (*get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata);\nextern PGDLLIMPORT get_relation_stats_hook_type get_relation_stats_hook;", "description": ["Hooks for plugins to get control when we ask for stats"]}, "18": {"facts": [{"label": "Interface type", "value": "get_relation_stats_hook_type"}, {"label": "Header", "value": "src/include/utils/selfuncs.h"}, {"label": "Subsystem", "value": "Statistics and estimation"}, {"label": "Initial value", "value": "NULL (no hook installed)"}], "related": [{"url": "/docs/18/planner-optimizer.html", "label": "The Planner/Optimizer"}], "release": {"ref": "REL_18_STABLE", "label": "18", "major": "18", "channel": "stable", "revision": "753057e340da8f22e57c9a409ea7a235fd6a46bd"}, "sources": [{"url": "https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/utils/selfuncs.h#L142", "path": "src/include/utils/selfuncs.h", "label": "Interface declaration", "sha256": "a3b64e2dd2d41eab2c162a2571bfbe98fac83ae9fab514b73d637220157a501a"}, {"url": "https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/utils/adt/selfuncs.c#L148", "path": "src/backend/utils/adt/selfuncs.c", "label": "Core definition", "sha256": "c51b0d3f9c9015e98278241c8efc28c39739a56337ffec1163427b3876170f19"}, {"url": "https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/utils/adt/selfuncs.c#L5717", "path": "src/backend/utils/adt/selfuncs.c", "label": "Call sites", "sha256": "c51b0d3f9c9015e98278241c8efc28c39739a56337ffec1163427b3876170f19"}], "sections": [{"title": "Call sites", "paragraphs": ["src/backend/utils/adt/selfuncs.c:5717", "src/backend/utils/adt/selfuncs.c:6198", "src/backend/utils/adt/selfuncs.c:8752"]}, {"code": "{\n\tRangeTblEntry *rte = root->simple_rte_array[var->varno];\n\n\tAssert(IsA(rte, RangeTblEntry));\n\n\tif (get_relation_stats_hook &&\n\t\t(*get_relation_stats_hook) (root, rte, var->varattno, vardata))\n\t{\n\t\t/*\n\t\t * The hook took control of acquiring a stats tuple.  If it did supply\n\t\t * a tuple, it'd better have supplied a freefunc.\n\t\t */\n\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t!vardata->freefunc)\n\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:5711\u20135725", "paragraphs": []}, {"code": "\t\trelid = rte->relid;\n\t\tAssert(relid != InvalidOid);\n\t\tcolnum = index->indexkeys[indexcol];\n\t\tvardata->rel = index->rel;\n\n\t\tif (get_relation_stats_hook &&\n\t\t\t(*get_relation_stats_hook) (root, rte, colnum, vardata))\n\t\t{\n\t\t\t/*\n\t\t\t * The hook took control of acquiring a stats tuple.  If it did\n\t\t\t * supply a tuple, it'd better have supplied a freefunc.\n\t\t\t */\n\t\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t\t!vardata->freefunc)\n\t\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:6192\u20136206", "paragraphs": []}, {"code": "\n\t\t/* attempt to lookup stats in relation for this index column */\n\t\tif (attnum != 0)\n\t\t{\n\t\t\t/* Simple variable -- look to stats for the underlying table */\n\t\t\tif (get_relation_stats_hook &&\n\t\t\t\t(*get_relation_stats_hook) (root, rte, attnum, &vardata))\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * The hook took control of acquiring a stats tuple.  If it\n\t\t\t\t * did supply a tuple, it'd better have supplied a freefunc.\n\t\t\t\t */\n\t\t\t\tif (HeapTupleIsValid(vardata.statsTuple) && !vardata.freefunc)\n\t\t\t\t\telog(ERROR,\n\t\t\t\t\t\t \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:8746\u20138760", "paragraphs": []}], "signature": "typedef bool (*get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata);\nextern PGDLLIMPORT get_relation_stats_hook_type get_relation_stats_hook;", "description": ["Hooks for plugins to get control when we ask for stats"]}, "19": {"facts": [{"label": "Interface type", "value": "get_relation_stats_hook_type"}, {"label": "Header", "value": "src/include/utils/selfuncs.h"}, {"label": "Subsystem", "value": "Statistics and estimation"}, {"label": "Initial value", "value": "NULL (no hook installed)"}], "related": [{"url": "/docs/19/planner-optimizer.html", "label": "The Planner/Optimizer"}], "release": {"ref": "REL_19_BETA4", "label": "19 Beta 4", "major": "19", "channel": "preview", "revision": "b73d13c32c834a2c8e1c60cb92f79530376cedf1"}, "sources": [{"url": "https://github.com/postgres/postgres/blob/b73d13c32c834a2c8e1c60cb92f79530376cedf1/src/include/utils/selfuncs.h#L149", "path": "src/include/utils/selfuncs.h", "label": "Interface declaration", "sha256": "7a49338488273cc2b9f37629eb1efa8304b35536e8b62e56d1ea69972f748d48"}, {"url": "https://github.com/postgres/postgres/blob/b73d13c32c834a2c8e1c60cb92f79530376cedf1/src/backend/utils/adt/selfuncs.c#L183", "path": "src/backend/utils/adt/selfuncs.c", "label": "Core definition", "sha256": "ce307caa3c344424565af0a1b2e19d2639bf56fbe7f73e7803e47f53f099dfcd"}, {"url": "https://github.com/postgres/postgres/blob/b73d13c32c834a2c8e1c60cb92f79530376cedf1/src/backend/utils/adt/selfuncs.c#L6056", "path": "src/backend/utils/adt/selfuncs.c", "label": "Call sites", "sha256": "ce307caa3c344424565af0a1b2e19d2639bf56fbe7f73e7803e47f53f099dfcd"}], "sections": [{"title": "Call sites", "paragraphs": ["src/backend/utils/adt/selfuncs.c:6056", "src/backend/utils/adt/selfuncs.c:6537", "src/backend/utils/adt/selfuncs.c:9116"]}, {"code": "{\n\tRangeTblEntry *rte = root->simple_rte_array[var->varno];\n\n\tAssert(IsA(rte, RangeTblEntry));\n\n\tif (get_relation_stats_hook &&\n\t\t(*get_relation_stats_hook) (root, rte, var->varattno, vardata))\n\t{\n\t\t/*\n\t\t * The hook took control of acquiring a stats tuple.  If it did supply\n\t\t * a tuple, it'd better have supplied a freefunc.\n\t\t */\n\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t!vardata->freefunc)\n\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:6050\u20136064", "paragraphs": []}, {"code": "\t\trelid = rte->relid;\n\t\tAssert(relid != InvalidOid);\n\t\tcolnum = index->indexkeys[indexcol];\n\t\tvardata->rel = index->rel;\n\n\t\tif (get_relation_stats_hook &&\n\t\t\t(*get_relation_stats_hook) (root, rte, colnum, vardata))\n\t\t{\n\t\t\t/*\n\t\t\t * The hook took control of acquiring a stats tuple.  If it did\n\t\t\t * supply a tuple, it'd better have supplied a freefunc.\n\t\t\t */\n\t\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t\t!vardata->freefunc)\n\t\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:6531\u20136545", "paragraphs": []}, {"code": "\n\t\t/* attempt to lookup stats in relation for this index column */\n\t\tif (attnum != 0)\n\t\t{\n\t\t\t/* Simple variable -- look to stats for the underlying table */\n\t\t\tif (get_relation_stats_hook &&\n\t\t\t\t(*get_relation_stats_hook) (root, rte, attnum, &vardata))\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * The hook took control of acquiring a stats tuple.  If it\n\t\t\t\t * did supply a tuple, it'd better have supplied a freefunc.\n\t\t\t\t */\n\t\t\t\tif (HeapTupleIsValid(vardata.statsTuple) && !vardata.freefunc)\n\t\t\t\t\telog(ERROR,\n\t\t\t\t\t\t \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:9110\u20139124", "paragraphs": []}], "signature": "typedef bool (*get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata);\nextern PGDLLIMPORT get_relation_stats_hook_type get_relation_stats_hook;", "description": ["Hooks for plugins to get control when we ask for stats"]}, "20": {"facts": [{"label": "Interface type", "value": "get_relation_stats_hook_type"}, {"label": "Header", "value": "src/include/utils/selfuncs.h"}, {"label": "Subsystem", "value": "Statistics and estimation"}, {"label": "Initial value", "value": "NULL (no hook installed)"}], "related": [{"url": "/docs/devel/planner-optimizer.html", "label": "The Planner/Optimizer"}], "release": {"ref": "master", "label": "20 devel", "major": "20", "channel": "devel", "revision": "2c10c2ce4d7bcd57543a49ab402af02a39724e0a"}, "sources": [{"url": "https://github.com/postgres/postgres/blob/2c10c2ce4d7bcd57543a49ab402af02a39724e0a/src/include/utils/selfuncs.h#L149", "path": "src/include/utils/selfuncs.h", "label": "Interface declaration", "sha256": "7a49338488273cc2b9f37629eb1efa8304b35536e8b62e56d1ea69972f748d48"}, {"url": "https://github.com/postgres/postgres/blob/2c10c2ce4d7bcd57543a49ab402af02a39724e0a/src/backend/utils/adt/selfuncs.c#L181", "path": "src/backend/utils/adt/selfuncs.c", "label": "Core definition", "sha256": "e944f9b47bb7ed57677bf10b54c7a0ef3d51c50796c04f31a46a7ac827608d56"}, {"url": "https://github.com/postgres/postgres/blob/2c10c2ce4d7bcd57543a49ab402af02a39724e0a/src/backend/utils/adt/selfuncs.c#L6054", "path": "src/backend/utils/adt/selfuncs.c", "label": "Call sites", "sha256": "e944f9b47bb7ed57677bf10b54c7a0ef3d51c50796c04f31a46a7ac827608d56"}], "sections": [{"title": "Call sites", "paragraphs": ["src/backend/utils/adt/selfuncs.c:6054", "src/backend/utils/adt/selfuncs.c:6627", "src/backend/utils/adt/selfuncs.c:9156"]}, {"code": "{\n\tRangeTblEntry *rte = root->simple_rte_array[var->varno];\n\n\tAssert(IsA(rte, RangeTblEntry));\n\n\tif (get_relation_stats_hook &&\n\t\t(*get_relation_stats_hook) (root, rte, var->varattno, vardata))\n\t{\n\t\t/*\n\t\t * The hook took control of acquiring a stats tuple.  If it did supply\n\t\t * a tuple, it'd better have supplied a freefunc.\n\t\t */\n\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t!vardata->freefunc)\n\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:6048\u20136062", "paragraphs": []}, {"code": "\t\trelid = rte->relid;\n\t\tAssert(relid != InvalidOid);\n\t\tcolnum = index->indexkeys[indexcol];\n\t\tvardata->rel = index->rel;\n\n\t\tif (get_relation_stats_hook &&\n\t\t\t(*get_relation_stats_hook) (root, rte, colnum, vardata))\n\t\t{\n\t\t\t/*\n\t\t\t * The hook took control of acquiring a stats tuple.  If it did\n\t\t\t * supply a tuple, it'd better have supplied a freefunc.\n\t\t\t */\n\t\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t\t!vardata->freefunc)\n\t\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:6621\u20136635", "paragraphs": []}, {"code": "\n\t\t/* attempt to lookup stats in relation for this index column */\n\t\tif (attnum != 0)\n\t\t{\n\t\t\t/* Simple variable -- look to stats for the underlying table */\n\t\t\tif (get_relation_stats_hook &&\n\t\t\t\t(*get_relation_stats_hook) (root, rte, attnum, &vardata))\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * The hook took control of acquiring a stats tuple.  If it\n\t\t\t\t * did supply a tuple, it'd better have supplied a freefunc.\n\t\t\t\t */\n\t\t\t\tif (HeapTupleIsValid(vardata.statsTuple) && !vardata.freefunc)\n\t\t\t\t\telog(ERROR,\n\t\t\t\t\t\t \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:9150\u20139164", "paragraphs": []}], "signature": "typedef bool (*get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata);\nextern PGDLLIMPORT get_relation_stats_hook_type get_relation_stats_hook;", "description": ["Hooks for plugins to get control when we ask for stats"]}}, "content_hash": "ac1568d690af48273e0bf228c6febb6054261afb5f9e0ddae42db5701d43d577", "imported_at": "2026-09-27T09:57:58.898"}, "snapshot": {"facts": [{"label": "Interface type", "value": "get_relation_stats_hook_type"}, {"label": "Header", "value": "src/include/utils/selfuncs.h"}, {"label": "Subsystem", "value": "Statistics and estimation"}, {"label": "Initial value", "value": "NULL (no hook installed)"}], "related": [{"url": "/docs/18/planner-optimizer.html", "label": "The Planner/Optimizer"}], "release": {"ref": "REL_18_STABLE", "label": "18", "major": "18", "channel": "stable", "revision": "753057e340da8f22e57c9a409ea7a235fd6a46bd"}, "sources": [{"url": "https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/utils/selfuncs.h#L142", "path": "src/include/utils/selfuncs.h", "label": "Interface declaration", "sha256": "a3b64e2dd2d41eab2c162a2571bfbe98fac83ae9fab514b73d637220157a501a"}, {"url": "https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/utils/adt/selfuncs.c#L148", "path": "src/backend/utils/adt/selfuncs.c", "label": "Core definition", "sha256": "c51b0d3f9c9015e98278241c8efc28c39739a56337ffec1163427b3876170f19"}, {"url": "https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/utils/adt/selfuncs.c#L5717", "path": "src/backend/utils/adt/selfuncs.c", "label": "Call sites", "sha256": "c51b0d3f9c9015e98278241c8efc28c39739a56337ffec1163427b3876170f19"}], "sections": [{"title": "Call sites", "paragraphs": ["src/backend/utils/adt/selfuncs.c:5717", "src/backend/utils/adt/selfuncs.c:6198", "src/backend/utils/adt/selfuncs.c:8752"]}, {"code": "{\n\tRangeTblEntry *rte = root->simple_rte_array[var->varno];\n\n\tAssert(IsA(rte, RangeTblEntry));\n\n\tif (get_relation_stats_hook &&\n\t\t(*get_relation_stats_hook) (root, rte, var->varattno, vardata))\n\t{\n\t\t/*\n\t\t * The hook took control of acquiring a stats tuple.  If it did supply\n\t\t * a tuple, it'd better have supplied a freefunc.\n\t\t */\n\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t!vardata->freefunc)\n\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:5711\u20135725", "paragraphs": []}, {"code": "\t\trelid = rte->relid;\n\t\tAssert(relid != InvalidOid);\n\t\tcolnum = index->indexkeys[indexcol];\n\t\tvardata->rel = index->rel;\n\n\t\tif (get_relation_stats_hook &&\n\t\t\t(*get_relation_stats_hook) (root, rte, colnum, vardata))\n\t\t{\n\t\t\t/*\n\t\t\t * The hook took control of acquiring a stats tuple.  If it did\n\t\t\t * supply a tuple, it'd better have supplied a freefunc.\n\t\t\t */\n\t\t\tif (HeapTupleIsValid(vardata->statsTuple) &&\n\t\t\t\t!vardata->freefunc)\n\t\t\t\telog(ERROR, \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:6192\u20136206", "paragraphs": []}, {"code": "\n\t\t/* attempt to lookup stats in relation for this index column */\n\t\tif (attnum != 0)\n\t\t{\n\t\t\t/* Simple variable -- look to stats for the underlying table */\n\t\t\tif (get_relation_stats_hook &&\n\t\t\t\t(*get_relation_stats_hook) (root, rte, attnum, &vardata))\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * The hook took control of acquiring a stats tuple.  If it\n\t\t\t\t * did supply a tuple, it'd better have supplied a freefunc.\n\t\t\t\t */\n\t\t\t\tif (HeapTupleIsValid(vardata.statsTuple) && !vardata.freefunc)\n\t\t\t\t\telog(ERROR,\n\t\t\t\t\t\t \"no function provided to release variable stats with\");", "title": "Core call context: src/backend/utils/adt/selfuncs.c:8746\u20138760", "paragraphs": []}], "signature": "typedef bool (*get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata);\nextern PGDLLIMPORT get_relation_stats_hook_type get_relation_stats_hook;", "description": ["Hooks for plugins to get control when we ask for stats"]}, "comparison": {"left": "17", "right": "18", "status": "unchanged", "diff": ""}}