12
返回列表 发新帖
楼主: ZALBB

分析的桶数多于唯一个数,为什么HISTOGRAM=HEIGHT BALANCE?

[复制链接]
论坛徽章:
1
2010新春纪念徽章
日期:2010-03-01 11:20:00
11#
发表于 2009-12-29 16:45 | 只看该作者
学习学习~

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
12#
发表于 2009-12-30 02:26 | 只看该作者
原帖由 棉花糖ONE 于 2009-12-28 19:30 发表
那地方虽然显示的是基于高度的直方图,实际上应该是基于频率的,只是h.bucket_cnt > h.distcnt 把那个过滤,我觉得USER_TAB_COL_STATISTICS 的定义里应该把h.bucket_cnt > h.distcnt 改成h.bucket_cnt > =h.distcnt 更合适


I realize that ZALBB's test and mine later are very special in that there're only a few values in total, each distinct. ZALBB, you didn't say but I'm sure you only have 6 values, each distinct from each other. Correct? In this special case, if you specify more buckets than number of (distinct) values, Oracle will create only that many buckets, each containing one value which is distinct. *In this case, the definition of both frequency (FH) and height-balanced histogram (HBH) applies!* You can tell from the endpoint_number column of user_tab_histogram. If the numbers in this column represent the ordinal numbers of the buckets (i.e., starting from 1, then 2, 3, etc), it's an HBH. If they represent cumulative counts over previous buckets (or rows in this view query output), it's an FH. But in this case, it's both.

My conclusion is that this special histogram can be called either type. So whether you change > to >= in the view definition as you suggested makes no difference.

Yong Huang

使用道具 举报

回复
论坛徽章:
314
行业板块每日发贴之星
日期:2012-07-12 18:47:29双黄蛋
日期:2011-08-12 17:31:04咸鸭蛋
日期:2011-08-18 15:13:51迷宫蛋
日期:2011-08-18 16:58:25紫蛋头
日期:2011-08-31 10:57:28ITPUB十周年纪念徽章
日期:2011-09-27 16:30:47蜘蛛蛋
日期:2011-10-20 15:51:25迷宫蛋
日期:2011-10-29 11:12:59ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41鲜花蛋
日期:2011-11-09 20:33:30
13#
 楼主| 发表于 2009-12-30 11:00 | 只看该作者
原帖由 Yong Huang 于 2009-12-30 02:26 发表


I realize that ZALBB's test and mine later are very special in that there're only a few values in total, each distinct. ZALBB, you didn't say but I'm sure you only have 6 values, each distinct from each other. Correct? In this special case, if you specify more buckets than number of (distinct) values, Oracle will create only that many buckets, each containing one value which is distinct. *In this case, the definition of both frequency (FH) and height-balanced histogram (HBH) applies!* You can tell from the endpoint_number column of user_tab_histogram. If the numbers in this column represent the ordinal numbers of the buckets (i.e., starting from 1, then 2, 3, etc), it's an HBH. If they represent cumulative counts over previous buckets (or rows in this view query output), it's an FH. But in this case, it's both.

My conclusion is that this special histogram can be called either type. So whether you change > to >= in the view definition as you suggested makes no difference.

Yong Huang


比较文档定义,这应该是个BUG。

使用道具 举报

回复
论坛徽章:
314
行业板块每日发贴之星
日期:2012-07-12 18:47:29双黄蛋
日期:2011-08-12 17:31:04咸鸭蛋
日期:2011-08-18 15:13:51迷宫蛋
日期:2011-08-18 16:58:25紫蛋头
日期:2011-08-31 10:57:28ITPUB十周年纪念徽章
日期:2011-09-27 16:30:47蜘蛛蛋
日期:2011-10-20 15:51:25迷宫蛋
日期:2011-10-29 11:12:59ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41鲜花蛋
日期:2011-11-09 20:33:30
14#
 楼主| 发表于 2009-12-31 09:32 | 只看该作者
咨询了ORACLE技术支持,答复是Bug 4704779,但据他们说,此BUG已经在10204版本上修复。但我的问题
恰恰就是在10204上出现的。

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
15#
发表于 2010-1-1 04:11 | 只看该作者
原帖由 ZALBB 于 2009-12-30 19:32 发表
咨询了ORACLE技术支持,答复是Bug 4704779,但据他们说,此BUG已经在10204版本上修复。但我的问题
恰恰就是在10204上出现的。


I don't think that bug is relevant, although on the surface it appears to be. I'm willing to say it may be a documentation bug in that the documentation says that as long as you speficy a bucket count greater than the number of distinct values, you get a frequency histogram. That's obviously incorrect.

And that's an issue different from the special case histogram, which I personally believe is both a frequency and height-balanced type, because it fits both definitions.

Yong Huang

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表