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

[讨论] index 集群因子高

[复制链接]
论坛徽章:
8
2009新春纪念徽章
日期:2009-01-04 14:52:28祖国60周年纪念徽章
日期:2009-10-09 08:28:002010新春纪念徽章
日期:2010-03-01 11:07:24ITPUB9周年纪念徽章
日期:2010-10-08 09:32:25ITPUB十周年纪念徽章
日期:2011-11-01 16:23:262013年新春福章
日期:2013-02-25 14:51:24沸羊羊
日期:2015-03-04 14:51:522015年新春福章
日期:2015-03-06 11:57:31
11#
发表于 2009-10-28 08:56 | 只看该作者
楼主这么分析有些牵强,应该还是应用的问题。

使用道具 举报

回复
论坛徽章:
6
BLOG每日发帖之星
日期:2009-10-06 01:01:02ITPUB9周年纪念徽章
日期:2010-10-08 09:28:51ITPUB9周年纪念徽章
日期:2010-10-08 09:28:53数据库板块每日发贴之星
日期:2010-12-06 01:01:01
12#
发表于 2009-10-28 11:02 | 只看该作者
原帖由 Yong Huang 于 2009-10-28 04:33 发表


To reduce the clustering factor of an index, you have to rebuild the table in the order of the index column(s). It sounds weird because a heap table is said to have no internal order. But more or less there *is* some order in it. To do this data re-ordering, you need to create a new table as select * from the old table order by the column(s) of the index. And make other changes as needed (constraints, etc).

The wait event "gc cr block 2-way" is not an idle wait. The parameters are undocumented. But I believe p1 and p2 are simply the file# and block#. How do you know this wait is related to the high index clustering factor? Did you check p1 and p2 in v$session or v$session_wait?

Always tell us Oracle version.

Yong Huang


Agree that it's not easy to control the cluster factor.

This wait event looks good if you do need to scan this amount of blocks unless you can do some tuning to your application requirement or sql performance.

使用道具 举报

回复
论坛徽章:
113
ITPUB9周年纪念徽章
日期:2010-10-08 09:28:512011新春纪念徽章
日期:2011-02-18 11:42:50现任管理团队成员
日期:2011-05-07 01:45:08ITPUB官方微博粉丝徽章
日期:2011-06-28 19:45:36蛋疼蛋
日期:2011-07-24 22:25:332012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:25
13#
发表于 2009-10-29 10:25 | 只看该作者
同样没找到具体的官方资料,但我还是转载一个牛人的观点吧:
这些等待可以被忽略。


The following wait events indicate that the remotely cached blocks were shipped to the local instance without having been busy, pinned or requiring a log flush and can safely be ignored:
* gc current block 2-way
* gc current block 3-way
* gc cr block 2-way
* gc cr block 3-way
http://www.dba-oracle.com/real_application_clusters_rac_grid/performance_analysis.htm

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
9
生肖徽章2007版:牛
日期:2009-03-10 21:26:492010新春纪念徽章
日期:2010-01-04 08:33:082010年世界杯参赛球队:葡萄牙
日期:2010-02-22 14:35:242010新春纪念徽章
日期:2010-03-01 11:19:092010广州亚运会纪念徽章:射击
日期:2010-09-08 23:42:12ITPUB9周年纪念徽章
日期:2010-10-08 09:31:212010广州亚运会纪念徽章:拳击
日期:2010-10-30 00:46:582011新春纪念徽章
日期:2011-02-18 11:43:322011新春纪念徽章
日期:2011-03-01 08:49:39
14#
发表于 2009-10-29 12:36 | 只看该作者
按照被索引列的进行排序重建表,可以降低该索引的clusering factor,但是就怕影响到同在这张表上面的索引的clusering factor。

使用道具 举报

回复
论坛徽章:
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#
发表于 2009-10-30 01:40 | 只看该作者
原帖由 viadeazhu 于 2009-10-28 20:25 发表
同样没找到具体的官方资料,但我还是转载一个牛人的观点吧:
这些等待可以被忽略。

The following wait events indicate that the remotely cached blocks were shipped to the local instance without having been busy, pinned or requiring a log flush and can safely be ignored:
* gc current block 2-way
* gc current block 3-way
* gc cr block 2-way
* gc cr block 3-way
http://www.dba-oracle.com/real_a ... rmance_analysis.htm


I disagree. These events should NOT be ignored. Their high numbers generally indicate high current or consistent gets.

Not all 牛人 are created equal. Ignore this one. Always take his words with a grain of salt.

Yong Huang

使用道具 举报

回复
论坛徽章:
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
16#
发表于 2009-10-30 01:41 | 只看该作者
原帖由 killkill_shadow 于 2009-10-28 22:36 发表
按照被索引列的进行排序重建表,可以降低该索引的clusering factor,但是就怕影响到同在这张表上面的索引的clusering factor。


Exactly. There's only one real (approximate) order in the table. Before you rebuild the table to make one index happy, keep other indexes in mind. Only do this for the most important index.

Yong Huang

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
9
生肖徽章2007版:牛
日期:2009-03-10 21:26:492010新春纪念徽章
日期:2010-01-04 08:33:082010年世界杯参赛球队:葡萄牙
日期:2010-02-22 14:35:242010新春纪念徽章
日期:2010-03-01 11:19:092010广州亚运会纪念徽章:射击
日期:2010-09-08 23:42:12ITPUB9周年纪念徽章
日期:2010-10-08 09:31:212010广州亚运会纪念徽章:拳击
日期:2010-10-30 00:46:582011新春纪念徽章
日期:2011-02-18 11:43:322011新春纪念徽章
日期:2011-03-01 08:49:39
17#
发表于 2009-11-11 16:16 | 只看该作者
原帖由 Yong Huang 于 2009-10-30 01:41 发表


Exactly. There's only one real (approximate) order in the table. Before you rebuild the table to make one index happy, keep other indexes in mind. Only do this for the most important index.

Yong Huang


Great!  That is the KEY POINT.
BTW : How to find out the most important (Hot,Most Use)  index any Good Idea or SQL ? ^_^

使用道具 举报

回复
论坛徽章:
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
18#
发表于 2009-11-12 02:44 | 只看该作者
原帖由 killkill_shadow 于 2009-11-11 02:16 发表
Great!  That is the KEY POINT.
BTW : How to find out the most important (Hot,Most Use)  index any Good Idea or SQL ? ^_^


There's no magic here. You just keep monitoring your database. Find the most expensive SQLs, in terms of buffer gets and buffer gets per execution. Check their plans. If some indexes are frequently used, focus on them. See if their clustering factors are high. Use your own judgement as to whether to reorganize the tables.

Yong Huang

使用道具 举报

回复

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

本版积分规则 发表回复

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