PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹43. 係䂘臘媆誕嬉誕

43.46. pg_stats

pg_stats 柊冕凹庻嗘婘 pg_statistic 臘麯麵䔇媇敇䔇螪閞㔗認婻蓖商噕螩埻螪閞闼底婘 pg_statistic 麯麵凹庫䫘潙橬溄鍊臂埡䔇臘䔇昄扞臯啹溴埇傖垬噘婄噕螩噸嚖螪閞認婻蓖商㔗

pg_stats 幘螆螇潊檪媇敇傖婔䓉敘滷臂䔇桹嚟庺䯄䔇嘵嚟垄懫婋北䔇係䂘臘敘垹滷黙臂傼備儌滇套悩婘 pg_statistic 麯垔幬庖桄䔇昄扞擘嘉闼幽媙釂欷匘垄䔇蓖商垔幬㔗

臘43-46. pg_stats 庖枕

劉庖䌂傋嚘䫘柟誄
schemanamenamepg_namespace.nspname寙劆溴臘䔇昇嚟劉庖
tablenamenamepg_class.relname臘䔇劉庖
attnamenamepg_attribute.attname認婔臯柟誄䔇庖枕䔇劉庖
null_fracreal 螄嘘婺庖枕婺䷺䔇䍆彖懫
avg_widthinteger 庖枕螄嘘傖庖誗螄䔇广庺垘庥
n_distinctreal 套悩崓庯镽儌滇婘庖枕婺䋸䆋昄唚䔇嚄螇昄䕞㔗套悩償庯镽儌滇䋸䆋昄唚䔇昄䕞赆臯昄鍴䔇蘘昄㔗䫘蘘昄嘵嚟滇啹婺 ANALYZE 螴婺䋸䆋昄唚䔇昄䕞滇锟五臘嵂阪蔯嵂阪溼昄䔇嘵嚟䫘庯婘庖枕䩋婪寂喘償橬啺垔䔇埇脘唚昄䕞䔇愙喕婋㔗懫套-1 臘䴺婔婻嫇婔庖枕䋸䆋昄唚䔇婻昄启臯昄䕩劯㔗
most_common_valsanyarray 婔婻庖枕麯橔婩䫘昄唚䔇彖臘㔗套悩䩋婪寂澇橬嘖昄唚懫噽垄敘婩蓕彍婺 NULL
most_common_freqsreal[] 婔婻橔婩䫘昄唚䔇鵏䯺䔇彖臘幘儌滇臘懟婻庺䯄䔇渇昄鍴傖臯昄㔗套悩 most_common_vals 滇 NULL 彍婺 NULL
histogram_boundsanyarray 婔婻昄唚䔇彖臘垄檪庖枕䔇昄唚彖潊庹䂇崓躘䕩劯䄺閘䔇䂇㔗套悩婘 most_common_vals 麯橬昄唚彍婘認婻閚商䔇螇䞖婺䩕䘖㔗套悩庖枕昄扞䌂傋澇橬 < 淉嘩严潡蔙 most_common_vals 彖臘傼臘庖昘婻彖婄攓彍認婻庖枕婺 NULL 㔗
correlationreal 䂘螇婯庖枕唚䔇䬷䊖臯废启锂膏臯废橬噿㔗垄䔇评啘傯 -1 彄 +1 㔗婘昄唚毖誏 -1 潡蔙 +1 䔇施唍婘庖枕婪䔇䘵嚘欆柟儖赆螴婺懫垄毖誏镽䔇施唍嚔體敘儏啹婺废儏庖凹伕䕻䔇锟橺螪閞㔗套悩庖枕昄扞䌂傋澇橬 < 淉嘩严闼幽認婻庖枕婺 NULL 㔗

most_common_valshistogram_bounds 昄䂇麯䔇噄䘹䔇橔崓昄䕞埇傖䫘 ALTER TABLE SET STATISTICS 变傴婔婻婔婻庖枕婄螆䘞潡蔙锔誺螆䘞誊臯施埗昄 default_statistics_target 噘匔婄螆䘞㔗


劯锔饡釕嬉誕
pg_shadow婪婔亓pg_tables