{"Entry":{"collection":"hook","key":"get_attavgwidth_hook","name":"get_attavgwidth_hook","aliases":[],"metadata":{"aliases":[],"category":"Statistics and estimation","content_hash":"04af6adb045a56da90e5fc2cd1899ee585db95a6076187116b4157aba2448317","imported_at":"2026-09-27T17:57:58.894076+08:00","name":"get_attavgwidth_hook","name_zh":"get_attavgwidth_hook","slug":"get_attavgwidth_hook","summary":"Hook for plugins to get control in get_attavgwidth()"}},"Definition":{"Collection":"hook","Key":"get_attavgwidth_hook","SourceDatabase":"center","Version":"18","SourceTable":"hook","SourceKey":"get_attavgwidth_hook","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","Facts":{"description":["Hook for plugins to get control in get_attavgwidth()"],"facts":[{"label":"Interface type","value":"get_attavgwidth_hook_type"},{"label":"Header","value":"src/include/utils/lsyscache.h"},{"label":"Subsystem","value":"Statistics and estimation"},{"label":"Initial value","value":"NULL (no hook installed)"}],"related":[{"label":"The Planner/Optimizer","url":"/docs/18/planner-optimizer.html"}],"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sections":[{"paragraphs":["src/backend/utils/cache/lsyscache.c:3467"],"title":"Call sites"},{"code":"{\n\tHeapTuple\ttp;\n\tint32\t\tstawidth;\n\n\tif (get_attavgwidth_hook)\n\t{\n\t\tstawidth = (*get_attavgwidth_hook) (relid, attnum);\n\t\tif (stawidth \u003e 0)\n\t\t\treturn stawidth;\n\t}\n\ttp = SearchSysCache3(STATRELATTINH,\n\t\t\t\t\t\t ObjectIdGetDatum(relid),\n\t\t\t\t\t\t Int16GetDatum(attnum),\n\t\t\t\t\t\t BoolGetDatum(false));\n\tif (HeapTupleIsValid(tp))","paragraphs":[],"title":"Core call context: src/backend/utils/cache/lsyscache.c:3461–3475"}],"signature":"typedef int32 (*get_attavgwidth_hook_type) (Oid relid, AttrNumber attnum);\nextern PGDLLIMPORT get_attavgwidth_hook_type get_attavgwidth_hook;","sources":[{"label":"Interface declaration","path":"src/include/utils/lsyscache.h","sha256":"48ab9cc15af02106e6710ea04b2738e8aea75b4956934ea8ec109c8c49daa834","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/utils/lsyscache.h#L66"},{"label":"Core definition","path":"src/backend/utils/cache/lsyscache.c","sha256":"43a22e20685c043936ddfeee032d0c06d9408d7edbadfa9417a2ede32e70b97d","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/utils/cache/lsyscache.c#L54"},{"label":"Call sites","path":"src/backend/utils/cache/lsyscache.c","sha256":"43a22e20685c043936ddfeee032d0c06d9408d7edbadfa9417a2ede32e70b97d","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/utils/cache/lsyscache.c#L3467"}]},"ManualEvidence":{"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sources":[{"label":"Interface declaration","path":"src/include/utils/lsyscache.h","sha256":"48ab9cc15af02106e6710ea04b2738e8aea75b4956934ea8ec109c8c49daa834","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/utils/lsyscache.h#L66"},{"label":"Core definition","path":"src/backend/utils/cache/lsyscache.c","sha256":"43a22e20685c043936ddfeee032d0c06d9408d7edbadfa9417a2ede32e70b97d","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/utils/cache/lsyscache.c#L54"},{"label":"Call sites","path":"src/backend/utils/cache/lsyscache.c","sha256":"43a22e20685c043936ddfeee032d0c06d9408d7edbadfa9417a2ede32e70b97d","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/utils/cache/lsyscache.c#L3467"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"get_attavgwidth_hook","SourceDatabase":"center","Version":"18","Locale":"en","Title":"get_attavgwidth_hook","Summary":"Hook for plugins to get control in get_attavgwidth()","BodyHTML":"\u003cp\u003eHook for plugins to get control in get_attavgwidth()\u003c/p\u003e","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","ContentHash":"a712e79df66a6094456a9aa2e645d7eb98a199c3dd604755b62de847ae589329","Payload":{"description":["Hook for plugins to get control in get_attavgwidth()"],"related":[{"label":"The Planner/Optimizer","url":"/docs/18/planner-optimizer.html"}],"sections":[{"paragraphs":["src/backend/utils/cache/lsyscache.c:3467"],"title":"Call sites"},{"code":"{\n\tHeapTuple\ttp;\n\tint32\t\tstawidth;\n\n\tif (get_attavgwidth_hook)\n\t{\n\t\tstawidth = (*get_attavgwidth_hook) (relid, attnum);\n\t\tif (stawidth \u003e 0)\n\t\t\treturn stawidth;\n\t}\n\ttp = SearchSysCache3(STATRELATTINH,\n\t\t\t\t\t\t ObjectIdGetDatum(relid),\n\t\t\t\t\t\t Int16GetDatum(attnum),\n\t\t\t\t\t\t BoolGetDatum(false));\n\tif (HeapTupleIsValid(tp))","paragraphs":[],"title":"Core call context: src/backend/utils/cache/lsyscache.c:3461–3475"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
