x线检查是什么| 三七长什么样| 什么什么情深| 肠易激综合征吃什么中成药| 人艰不拆是什么意思| 平均血红蛋白含量偏低是什么意思| 来月经适合吃什么水果| 求知欲的欲什么意思| 经常上火口腔溃疡是什么原因| 天花是什么病| 什么生机| 低温烫伤是什么意思| 支气管炎吃什么好| 母螳螂为什么要吃公螳螂| 乙肝前s1抗原阳性是什么意思| 牙槽骨吸收是什么意思| mrmrs是什么牌子| spf是什么意思| 甲功七项挂什么科| 去医院要带什么| 精华液是什么| 用盐水泡脚有什么好处| 一岁宝宝能吃什么水果| 食管反流吃什么药| 月经来黑色是什么原因| 小学生什么时候开学| mlb中文叫什么| 什么是痔疮早期图片| 白色五行属什么| 婴儿打嗝是什么原因引起的| 属猪本命佛是什么佛| 阿托伐他汀钙片治什么病| 张三李四王五赵六后面是什么| 香菇配什么菜好吃| 仓鼠可以吃什么水果| 水疗是什么意思| 嘴唇发紫是什么原因| 比肩劫财是什么意思| 搪瓷杯为什么被淘汰了| 重阳节是干什么的| 喝最烈的酒下一句是什么| 牛肉粉是什么调料| 急性肠胃炎吃什么食物| 用白醋泡脚有什么好处| 总胆红素偏高有什么危害| 身体发麻是什么原因| 月球表面的坑叫什么| 年兽叫什么| 冷酷是什么意思| 石见读什么| 中指戴戒指代表什么| 砖红色是什么颜色| 臀纹不对称有什么影响| 拉拉是什么| 缺钾是什么原因引起| 群星是什么意思| 守岁是什么意思| 公鸡为什么会打鸣| 喉咙疼吃什么水果好| 低盐饮食有利于预防什么疾病| 血小板低有什么危害| 女鼠和什么属相最配对| 吃什么润肺养肺最快| 人大是干什么的| 牛油果是什么季节的水果| 秋天有什么水果成熟| 梦见大蜈蚣是什么预兆| 睡不着觉什么原因| 动员是什么意思| 古代的天花是现代的什么病| 什么是精液| 湿疹擦什么药膏好| 晚霞是什么颜色的| 肚子隐隐作痛什么原因| 气虚血瘀吃什么中成药| 儿童看牙齿挂什么科| 花旦是什么意思| 软组织损伤是什么意思| 本科毕业证是什么颜色| rock什么意思| 脸红是什么原因引起的| 鸽子咳嗽吃什么药最好| 吃什么水果能长高| c是什么车| 情人节送妈妈什么花| 经期吃什么水果好| 丑未相冲的结果是什么| 不是什么| 为什么活得这么累| 最好的避孕方法是什么| 土耳其浴是什么意思| 肛门痒用什么药| 太平天国失败的根本原因是什么| 肾虚吃什么补肾| mrcp检查是什么意思| 鸡柳是什么肉| 6什么意思| 内向的人适合什么工作| 用盐水漱口有什么好处| 米老鼠叫什么名字| 什么伤医院不能治| 汤姆猫是什么品种| 五月十九日是什么星座| 肚子胀气老放屁是什么原因| 结膜炎是什么症状| 有酒瘾是什么感觉| 汗疱疹用什么药膏最好| 720是什么意思| 奥康属于什么档次| ppsu是什么材质| 属龙的本命佛是什么佛| 呃逆吃什么药| 什么食物含钙| 宝宝发烧手脚冰凉是什么原因| 苹果煮水喝有什么好处和坏处| 和风什么| total什么意思| 挑刺是什么意思| 肚子咕咕叫放屁多是什么原因| 中人是什么意思| 三尖瓣轻度反流是什么意思| 什么情况下血压会升高| 橙色五行属什么| ab血型和o血型的孩子是什么血型| 尿道感染吃什么消炎药| 亲和力是什么意思| 老年人脚浮肿是什么原因| cll是什么意思| sport什么品牌| 本番是什么意思| 内膜增生是什么意思| 澳门什么时候回归的| sdh是什么意思| 杨柳是什么生肖| 一什么鹿角| 怀孕前三个月应该注意什么| 七十岁是什么之年| 腾蛇是什么意思| 油炸食品用什么油最好| 吃什么好| 灌肠什么意思| 什么叫口腔溃疡| 护理专业是干什么的| 脚肿腿肿是什么原因引起的| 帕金森是什么| butterfly什么意思| cl是什么元素| 九死一生什么生肖| 拔完智齿吃什么| 毛囊是什么样子图片| suki什么意思| 女人小便疼是什么原因| 疾控中心属于什么单位| 心脏右束支传导阻滞是什么意思| 沙中土是什么意思| cindy英文名什么意思| 肺气肿是什么病| 诱发电位是检查什么病的| 甲状腺结节不能吃什么| 头发突然秃了一块是什么原因| 米糠是什么东西| 天蝎什么象| 厌氧菌是什么意思| 潴留囊肿是什么意思| 脂溢性脱发是什么意思| 铁达时手表什么档次| 鬼最怕什么东西| nub是什么意思| 嘴唇干裂是什么原因| 空调制冷量是什么意思| 月经没来吃什么药可以催月经来| cv是什么| 男性尿血是什么原因导致的| 机器灵砍菜刀是什么意思| 胃疼检查什么项目| 新晋是什么意思| vivo手机是什么牌子| hcd是什么意思| 脸红是什么原因| 长骨刺是什么原因导致的| 没有排卵是什么原因| 夜尿多什么原因| 焦糖色是什么颜色| 癫疯病发作前兆有什么症状| 丰的部首是什么偏旁| 装牙套有什么坏处| 什么时间艾灸效果最好| 南浦是什么意思| 藏青色是什么颜色| 降头是什么意思| 戒色有什么好处| 手气是什么原因引起的| 结石挂什么科| 儿童咳嗽吃什么药管用| 榔头是什么意思| 嗓子疼吃什么消炎药| 水丸是什么意思| 耋是什么意思| 盲人按摩有什么好处| 鸡口牛后是什么生肖| 林黛玉属什么生肖| 神经病吃什么药效果好| mua什么意思| 就诊卡是什么| 颈椎引起的头晕是什么症状| 乳房突然疼痛什么原因| 宫颈潴留囊肿是什么意思| 头发麻是什么原因| kenzo属于什么档次| 什么样的孙悟空| 腿麻脚麻用什么药能治| 杨梅是什么季节的水果| 买车置换是什么意思| 黄曲霉素是什么| 保拉纳啤酒什么档次| 贵州有什么山| 晕车药吃多了有什么副作用| 早孕反应最早什么时候出现| 丑是什么意思| 爬楼是什么意思| 盆腔炎有什么症状| 癫痫挂什么科| 水解是什么意思| 胎方位loa是什么意思| 吃百香果有什么好处| 纳豆是什么豆子| 钢笔刻字刻什么好| 霍山石斛有什么作用| 棕色裤子配什么颜色上衣| 革兰阳性杆菌是什么病| 老化是什么意思| wtf是什么意思| 虾虎鱼吃什么| 女人喝蛇汤有什么好处| 少帅是什么军衔| 黄芪和什么泡水壮阳| 派特ct主要检查什么| 老是睡不着觉是什么原因| 小孩办理护照需要什么材料| iron什么意思| 梦见烙饼是什么意思| 心跳过快有什么危害| 烊什么意思| 8月27号是什么星座| 七月份怀孕预产期是什么时候| 中暑是什么原因| 李健是清华什么专业| 恒牙是什么牙| 匙仁是牛的什么部位| 杏花什么季节开| 吸尘器什么牌子好| 肺不好的人吃什么好| 人头马是什么酒| 吃头孢为什么不能喝酒| 巾帼指什么| 易烊千玺的真名叫什么| 口水多吃什么药好得快| 心脏病人吃什么水果好| 上海有什么好玩的地方旅游景点| 女性睾酮低说明什么| 小老弟是什么意思| 孕妇感冒了对胎儿有什么影响| kids是什么牌子| 交警支队长是什么级别| 百度
Supported Versions: Current (17) / 16 / 15 / 14 / 13
Development Versions: 18 / devel
Unsupported versions: 12 / 11 / 10
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead.

CREATE STATISTICS

CREATE STATISTICS — define extended statistics

Synopsis

CREATE STATISTICS [ IF NOT EXISTS ] statistics_name
    [ ( statistics_kind [, ... ] ) ]
    ON column_name, column_name [, ...]
    FROM table_name

Description

CREATE STATISTICS will create a new extended statistics object tracking data about the specified table, foreign table or materialized view. The statistics object will be created in the current database and will be owned by the user issuing the command.

If a schema name is given (for example, CREATE STATISTICS myschema.mystat ...) then the statistics object is created in the specified schema. Otherwise it is created in the current schema. The name of the statistics object must be distinct from the name of any other statistics object in the same schema.

Parameters

IF NOT EXISTS

Do not throw an error if a statistics object with the same name already exists. A notice is issued in this case. Note that only the name of the statistics object is considered here, not the details of its definition.

statistics_name

The name (optionally schema-qualified) of the statistics object to be created.

statistics_kind

A statistics kind to be computed in this statistics object. Currently supported kinds are ndistinct, which enables n-distinct statistics, dependencies, which enables functional dependency statistics, and mcv which enables most-common values lists. If this clause is omitted, all supported statistics kinds are included in the statistics object. For more information, see Section 14.2.2 and Section 71.2.

column_name

The name of a table column to be covered by the computed statistics. At least two column names must be given; the order of the column names is insignificant.

table_name

The name (optionally schema-qualified) of the table containing the column(s) the statistics are computed on; see ANALYZE for an explanation of the handling of inheritance and partitions.

Notes

You must be the owner of a table to create a statistics object reading it. Once created, however, the ownership of the statistics object is independent of the underlying table(s).

Extended statistics are not currently used by the planner for selectivity estimations made for table joins. This limitation will likely be removed in a future version of PostgreSQL.

Examples

Create table t1 with two functionally dependent columns, i.e., knowledge of a value in the first column is sufficient for determining the value in the other column. Then functional dependency statistics are built on those columns:

CREATE TABLE t1 (
    a   int,
    b   int
);

INSERT INTO t1 SELECT i/100, i/500
                 FROM generate_series(1,1000000) s(i);

ANALYZE t1;

-- the number of matching rows will be drastically underestimated:
EXPLAIN ANALYZE SELECT * FROM t1 WHERE (a = 1) AND (b = 0);

CREATE STATISTICS s1 (dependencies) ON a, b FROM t1;

ANALYZE t1;

-- now the row count estimate is more accurate:
EXPLAIN ANALYZE SELECT * FROM t1 WHERE (a = 1) AND (b = 0);

Without functional-dependency statistics, the planner would assume that the two WHERE conditions are independent, and would multiply their selectivities together to arrive at a much-too-small row count estimate. With such statistics, the planner recognizes that the WHERE conditions are redundant and does not underestimate the row count.

Create table t2 with two perfectly correlated columns (containing identical data), and a MCV list on those columns:

CREATE TABLE t2 (
    a   int,
    b   int
);

INSERT INTO t2 SELECT mod(i,100), mod(i,100)
                 FROM generate_series(1,1000000) s(i);

CREATE STATISTICS s2 (mcv) ON a, b FROM t2;

ANALYZE t2;

-- valid combination (found in MCV)
EXPLAIN ANALYZE SELECT * FROM t2 WHERE (a = 1) AND (b = 1);

-- invalid combination (not found in MCV)
EXPLAIN ANALYZE SELECT * FROM t2 WHERE (a = 1) AND (b = 2);

The MCV list gives the planner more detailed information about the specific values that commonly appear in the table, as well as an upper bound on the selectivities of combinations of values that do not appear in the table, allowing it to generate better estimates in both cases.

Compatibility

There is no CREATE STATISTICS command in the SQL standard.

补钙什么时间段最好 焦虑症什么症状 三点水弘读什么 为什么单位不愿意申请工伤 袁崇焕为什么杀毛文龙
袋鼠喜欢吃什么食物 74年属什么 visa卡是什么 心情沉重是什么意思 超级碗是什么比赛
大姨妈不来是什么原因造成的 菊花有什么功效 气虚吃什么补最快 闺蜜过生日送什么礼物好 什么叫形而上学
食管挂什么科 茯苓有什么作用 炎细胞是什么意思 日仄念什么 百事可乐和可口可乐有什么区别
为什么外阴老是长疖子hcv9jop4ns6r.cn 什么蔬菜补血hcv9jop1ns7r.cn quake是什么意思hcv8jop8ns0r.cn 九四年属什么生肖hcv8jop2ns1r.cn 舌苔厚腻是什么原因hcv8jop9ns8r.cn
老年脑改变是什么意思hlguo.com 下水是什么意思hcv9jop6ns3r.cn 高粱是什么粮食jasonfriends.com 魑魅魍魉什么意思hcv8jop8ns7r.cn complete是什么意思hcv8jop6ns5r.cn
本是什么生肖hcv7jop6ns4r.cn 女人吃猪肝有什么好处xinjiangjialails.com 1020是什么星座zsyouku.com 发财树用什么肥料最好hcv9jop1ns0r.cn rag什么意思hcv9jop5ns2r.cn
喉咙卡鱼刺挂什么科hcv9jop1ns7r.cn 碘伏过敏是什么症状hcv9jop6ns5r.cn 藜芦是什么东西zhongyiyatai.com 什么自行车最贵hcv7jop9ns9r.cn 蹲久了站起来头晕是什么原因huizhijixie.com
百度