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

DROP INDEX的影响

[复制链接]
论坛徽章:
5
数据库板块每日发贴之星
日期:2005-08-04 01:01:32ITPUB元老
日期:2005-09-14 09:25:53授权会员
日期:2005-10-30 17:05:33会员2007贡献徽章
日期:2007-09-26 18:42:10ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44
11#
发表于 2005-11-23 16:27 | 只看该作者
肯定不会影响应用的。

使用道具 举报

回复
论坛徽章:
62
马上加薪
日期:2014-02-19 11:55:142011新春纪念徽章
日期:2011-02-18 11:43:332010广州亚运会纪念徽章:田径
日期:2011-02-17 18:03:352011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:502011新春纪念徽章
日期:2011-01-25 15:41:012010广州亚运会纪念徽章:三项全能
日期:2010-11-15 13:36:51ITPUB9周年纪念徽章
日期:2010-10-08 09:34:02
12#
发表于 2005-11-25 16:49 | 只看该作者
for index a the leading column is the same as index b,so when a sql using index b ,after index b is dropped ,
system auto choose index a for that 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
13#
发表于 2005-11-26 07:02 | 只看该作者
One thing I can think of is that if the original plan has an index range scan (or even full index scan or fast full scan) on A and when A is dropped, a range scan on B could be too expensive (too many blocks) for CBO to continue to range scan. So CBO decides to use full table scan instead. This is a contrived case. But you may be able to create a case where this plan change happens.

Yong Huang

使用道具 举报

回复
论坛徽章:
131
2006年度最佳技术回答
日期:2007-01-24 12:58:48福特
日期:2013-10-24 13:57:422014年新春福章
日期:2014-02-18 16:41:11马上有车
日期:2014-02-18 16:41:11马上有车
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有对象
日期:2014-02-19 11:55:14马上加薪
日期:2014-02-19 11:55:142013年新春福章
日期:2013-02-25 14:51:24
14#
发表于 2005-11-28 13:13 | 只看该作者
很难说

建议模拟你们的生产环境,做一个完整的测试~~

使用道具 举报

回复
论坛徽章:
2
生肖徽章2007版:鸡
日期:2008-01-02 17:35:53生肖徽章2007版:鼠
日期:2008-01-02 17:35:53
15#
 楼主| 发表于 2005-11-28 16:12 | 只看该作者
最初由 Yong Huang 发布
[B]One thing I can think of is that if the original plan has an index range scan (or even full index scan or fast full scan) on A and when A is dropped, a range scan on B could be too expensive (too many blocks) for CBO to continue to range scan. So CBO decides to use full table scan instead. This is a contrived case. But you may be able to create a case where this plan change happens.

Yong Huang [/B]


正在使用中的index没有办法drop吧!

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
17
会员2007贡献徽章
日期:2007-09-26 18:42:10ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:442010新春纪念徽章
日期:2010-03-01 11:20:05
16#
发表于 2005-11-28 17:00 | 只看该作者
最初由 chriszhang_1117 发布
[B]

example:
index A: user_info_ind1 索引建立栏位:user_id+user_no+create_date
index B: user_info_ind2 索引建立栏位:user_id

我的意思是说Drop index B后,
如果之前应用有用到index B,那么Drop Index B后对应用的影响有多大,还是说应用会自动去使用index A? [/B]


从理论上讲不会,只是使用A索引的代价可能比较大了。

使用道具 举报

回复
论坛徽章:
2
生肖徽章2007版:鸡
日期:2008-01-02 17:35:53生肖徽章2007版:鼠
日期:2008-01-02 17:35:53
17#
 楼主| 发表于 2005-11-29 08:15 | 只看该作者
最初由 rwq_ 发布
[B]

从理论上讲不会,只是使用A索引的代价可能比较大了。 [/B]


什么理论?
有什么文档资料可以参考?

使用道具 举报

回复
论坛徽章:
131
2006年度最佳技术回答
日期:2007-01-24 12:58:48福特
日期:2013-10-24 13:57:422014年新春福章
日期:2014-02-18 16:41:11马上有车
日期:2014-02-18 16:41:11马上有车
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有对象
日期:2014-02-19 11:55:14马上加薪
日期:2014-02-19 11:55:142013年新春福章
日期:2013-02-25 14:51:24
18#
发表于 2005-11-29 17:27 | 只看该作者
最初由 rwq_ 发布
[B]

从理论上讲不会,只是使用A索引的代价可能比较大了。 [/B]


hehe
代价大了,可能就代表着PLAN会变了~~

使用道具 举报

回复
论坛徽章:
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
19#
发表于 2005-11-29 22:27 | 只看该作者
最初由 chriszhang_1117 发布
[B]
什么理论?
有什么文档资料可以参考? [/B]


The cost may be the same for index unique scan but higher for other index scans. We need to do tests to confirm.

Yong Huang

使用道具 举报

回复

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

本版积分规则 发表回复

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