linux怎样更新informix数据,informix中理解统计更新

informix中理解统计更新

理解informix中的统计更新

内容提要:

1.介绍统计更新

当一个查询提交后,IDS优化器会算出如何执行这个查询的执行计划,优化器会分配成本

到每个执行计划,最后选择成本最低的那个执行计划。

统计更新主要有三个功能

(1)重新编译SPL

(2)删除distribution数据

(3)为优化器搜集必要信息

当计算一个执行计划成本时,优化器必须根据系统表来计算,主要是systables, sysindexes, syscolumns, and sysdistrib,

这些表中的某些关键列被使用。

systables (nrows, npused)

sysindexes (levels, leaves, nunique, clust)

syscolumns (colmin , colmax)

nrows - number of rows in the table

npused - number of data pages in the table

levels - number of levels of the btree index

leaves - number of leaves (lowest level) in the index

nunique - number of unique items in the first column of the index

clust - number of io operations required to access the index

colmin - the second lowest value in the table

colmax - the second hightest value in the table

当执行low级别优化时候,会重新更新这些表中相应字段的信息,为得到更多详细表的信息,必须创建data distribution,使用medium 或者 high 级别优化

才能产生data distribution信息,并且把这些信息存储到表sysdistrib中。很多情况里面,只使用systables,sysindexes,syscolumns会导致优化器不能选择一个

最佳的执行计划,所以必须创建data distribution信息。

2. 统计更新搜集信息

Data distribution信息产生是通过取样本列数据,然后排序,然后创建distributions bins,然后把这些记录插入到sysdistrib表中。

如果是high级别,样本数据是整个表。如果是medium级别,样本数据基于confidence和resolution参数。

基于confidence和resolution的样本数据的尺寸:

3. 统计更新的效率

提高效率主要有以下几部分。:

提高并行度

在创建data distribution过程中,数据排序是最耗时间的,所以必须打开PDQ,提高排序速度。

增加I/O吞吐

由于HIGH级别扫描整个表,对于大表可以使用light scan提高I/O吞吐。

Use of light scan to improve I/O throughput in big table,It will scan all table in high mode,so if it is a big table,we might use light scan to improve I/O scan.

减少取样数据

你可以通过控制样本数据尺寸扫描来提高统计更新的效率。

说明:

统计更新操作是informix数据库必须执行的操作,对于informix生产系统的性能起着决定性作用。

参考资料:

informix information center

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值