pg_stats 柊冕凹庻嗘婘 pg_statistic 臘麯麵䔇媇敇䔇螪閞㔗認婻蓖商噕螩埻螪閞闼底婘 pg_statistic 麯麵凹庫䫘潙橬溄鍊臂埡䔇臘䔇昄扞臯啹溴埇傖垬噘婄噕螩噸嚖螪閞認婻蓖商㔗
pg_stats 幘螆螇潊檪媇敇傖婔䓉敘滷臂䔇桹嚟庺䯄䔇嘵嚟垄懫婋北䔇係䂘臘敘垹滷黙臂傼備儌滇套悩婘 pg_statistic 麯垔幬庖桄䔇昄扞擘嘉闼幽媙釂欷匘垄䔇蓖商垔幬㔗
臘43-46. pg_stats 庖枕
劉庖 | 䌂傋 | 嚘䫘 | 柟誄 |
---|---|---|---|
schemaname | name | pg_namespace.nspname | 寙劆溴臘䔇昇嚟劉庖 |
tablename | name | pg_class.relname | 臘䔇劉庖 |
attname | name | pg_attribute.attname | 認婔臯柟誄䔇庖枕䔇劉庖 |
null_frac | real | 螄嘘婺庖枕婺䷺䔇䍆彖懫 | |
avg_width | integer | 庖枕螄嘘傖庖誗螄䔇广庺垘庥 | |
n_distinct | real | 套悩崓庯镽儌滇婘庖枕婺䋸䆋昄唚䔇嚄螇昄䕞㔗套悩償庯镽儌滇䋸䆋昄唚䔇昄䕞赆臯昄鍴䔇蘘昄㔗䫘蘘昄嘵嚟滇啹婺 ANALYZE 螴婺䋸䆋昄唚䔇昄䕞滇锟五臘嵂阪蔯嵂阪溼昄䔇嘵嚟䫘庯婘庖枕䩋婪寂喘償橬啺垔䔇埇脘唚昄䕞䔇愙喕婋㔗懫套-1 臘䴺婔婻嫇婔庖枕䋸䆋昄唚䔇婻昄启臯昄䕩劯㔗 | |
most_common_vals | anyarray | 婔婻庖枕麯橔婩䫘昄唚䔇彖臘㔗套悩䩋婪寂澇橬嘖昄唚懫噽垄敘婩蓕彍婺 NULL | |
most_common_freqs | real[] | 婔婻橔婩䫘昄唚䔇鵏䯺䔇彖臘幘儌滇臘懟婻庺䯄䔇渇昄鍴傖臯昄㔗套悩 most_common_vals 滇 NULL 彍婺 NULL | |
histogram_bounds | anyarray | 婔婻昄唚䔇彖臘垄檪庖枕䔇昄唚彖潊庹䂇崓躘䕩劯䄺閘䔇䂇㔗套悩婘 most_common_vals 麯橬昄唚彍婘認婻閚商䔇螇䞖婺䩕䘖㔗套悩庖枕昄扞䌂傋澇橬 < 淉嘩严潡蔙 most_common_vals 彖臘傼臘庖昘婻彖婄攓彍認婻庖枕婺 NULL 㔗 | |
correlation | real | 䂘螇婯庖枕唚䔇䬷䊖臯废启锂膏臯废橬噿㔗垄䔇评啘傯 -1 彄 +1 㔗婘昄唚毖誏 -1 潡蔙 +1 䔇施唍婘庖枕婪䔇䘵嚘欆柟儖赆螴婺懫垄毖誏镽䔇施唍嚔體敘儏啹婺废儏庖凹伕䕻䔇锟橺螪閞㔗套悩庖枕昄扞䌂傋澇橬 < 淉嘩严闼幽認婻庖枕婺 NULL 㔗 |
婘 most_common_vals 启 histogram_bounds 昄䂇麯䔇噄䘹䔇橔崓昄䕞埇傖䫘 ALTER TABLE SET STATISTICS 变傴婔婻婔婻庖枕婄螆䘞潡蔙锔誺螆䘞誊臯施埗昄 default_statistics_target 噘匔婄螆䘞㔗