如何估算Oracle索引的大小? [英] How can I estimate the size of an Oracle index?

查看:232
本文介绍了如何估算Oracle索引的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑向Oracle表中添加索引,但是我想在建立索引之后首先估计索引的大小(我不需要精确的大小-只需一个估计即可.)

假设我可以访问有关表的所有元数据(行数,列数,列数据类型等),那么我可以执行任何任意的Oracle SQL查询来获取有关表当前状态的其他数据,我知道我希望索引定义是什么,如何估计该大小?

解决方案

您可以使用以下 Oracle Capacity规划和调整电子表格大小.

对于不太成熟的内容,如果您只想返回信封类型,请输入 解决方案

You can use these Oracle Capacity planning and Sizing Spreadsheets.

For something not quite as full-blown, if you just want back of the envelope type rough estimates for the index:

Calculate the average size of each of the columns that make up the index key and sum the columns plus one rowid and add 2 bytes for the index row header to get the average row size. Now add just a little to the pctfree value for the index to come up with an overhead factor, maybe 1.125 for pctfree of 10.

number of indexed table rows X avg row len X 1.125

Note - if the index contains nullable columns then every table row may not appear in the index. On a single column index where 90% of the columns are null only 10% would go into the index.

Compare estimate to tablespace extent allocation method and adjust final answer if necessary.

Also a larger overhead factor may be better as the index gets bigger since the more data indexed the more branch blocks necessary to support the index structure and the calculation really just figures for leaf blocks.

这篇关于如何估算Oracle索引的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆