12
返回列表 发新帖
楼主: wantfly-pb

求解:为什么一个只有四行的表物理读却有近三万次?

[复制链接]
论坛徽章:
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
11#
发表于 2011-12-13 23:57 | 只看该作者
wantfly-pb,

Thanks for the pointer to Tom's Q&A. The words you quoted are about the resource usage of actual moving of data. That is, once you give the permission for row movement, moving the rows (as in case of alter table shrink space) will "consume processing resources...". My question is, Is leaving a table row movement enabled a bad idea? I think his answer at "March 10, 2009 - 2am" is what I need, "Any overhead? No, it is just permission to change a rowid if you do an operation that would cause a rowid to change - like...".

By the way, shrinking a table does not change the index to unusable as moving a table does. In fact, shrinking a table doesn't change the table's last_ddl_time either (but will change the index's), and doesn't invalidate the cursor using the table. It's a strange DDL in this respect.

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
12#
发表于 2011-12-14 00:05 | 只看该作者
> 有没有什么方法可以自动产生一个报表,来报告这种高水位问题,监控哪一张表有高水位问题,将IO浪费减到最小呢?

If your tablespace is ASSM, you can use dbms_space.space_usage to check space usage. (If it's non-ASSM, use free_space procedure.) I have the simple code at the bottom of http://yong321.freeshell.org/oranotes/Dbms_Space.txt

You could choose to dump the segment header of each segment you want to check (maybe only those big ones). But then you have to write code in your script to convert that hwm hex number to file and block number and do some judgement. It's doable. But it's easier to just check for a great amount of empty space with space_usage procedure.

Yong Huang

使用道具 举报

回复
论坛徽章:
9
蜘蛛蛋
日期:2011-12-28 14:46:28ITPUB季度 技术新星
日期:2012-05-22 15:10:11蛋疼蛋
日期:2012-05-28 16:48:46蜘蛛蛋
日期:2012-05-28 16:54:09茶鸡蛋
日期:2012-05-28 17:27:32双黄蛋
日期:2012-05-28 17:45:17迷宫蛋
日期:2012-05-29 10:49:35蛋疼蛋
日期:2012-06-04 17:13:15优秀写手
日期:2013-12-18 09:29:11
13#
发表于 2011-12-16 11:27 | 只看该作者

使用道具 举报

回复
论坛徽章:
86
2015中国数据库技术大会纪念徽章
日期:2015-04-24 16:04:24马上有车
日期:2014-02-19 11:55:14马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11优秀写手
日期:2013-12-18 09:29:11日产
日期:2013-10-17 08:44:39马自达
日期:2013-08-26 16:28:022013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-23 16:55:51马上有房
日期:2014-02-19 11:55:14
14#
发表于 2011-12-29 08:26 | 只看该作者
wantfly-pb 发表于 2011-12-13 10:53
对这个问题的思考:

这种高水位的现象,假设test表中原来有一千万笔数据,经过多次新增,删除操作后,目 ...

生产情况下,如果有合理的索引,一般大表都采用索引扫描的方式,因此,数据分散分布不会带来太大的影响。

如果是典型的OLAP,一般都是批量加载数据的,也很难产生大量的碎片。

使用道具 举报

回复
论坛徽章:
2
2012新春纪念徽章
日期:2012-01-04 11:51:22茶鸡蛋
日期:2012-12-23 22:48:29
15#
发表于 2011-12-30 13:50 | 只看该作者
本帖最后由 napolone1983 于 2011-12-30 14:11 编辑
wantfly-pb 发表于 2011-12-13 10:53
对这个问题的思考:

这种高水位的现象,假设test表中原来有一千万笔数据,经过多次新增,删除操作后,目 ...


高水位问题只会发生在全表扫描中,一般情况下,对索引查询影响不大。
有个问题没搞明白,既然段头中保存着最后一个使用块的信息,在全表扫描的情况下至少应该从最后一个数据块往下扫描,而不应该从HWM开始吧?

使用道具 举报

回复
论坛徽章:
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#
发表于 2012-1-1 11:30 | 只看该作者
> 在全表扫描的情况下至少应该从最后一个数据块往下扫描,而不应该从HWM开始吧?

What do you mean? A full table scan starts from the first block until the last (i.e. HWM), not from the last till somewhere.

Yong Huang

使用道具 举报

回复

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

本版积分规则 发表回复

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