由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - SQL 2008 Create Index vs Rebuild Index (Alter Index)
相关主题
SQL 2000 create index 問題When should I reorganize Index/Rebuuild Index?
被人鄙视了MS SQL怎么加conditional check
How to make import (>200M) faster?骑驴找马记
indexing就是设置primary key吗?how to remove fulltext index?
mysql rebuild index very slowMySQL 5.0 cluster question
Oracle Group and Index question如何决定index
请教 sql server index问题问个Index的问题
mysql 如何更新一个表的index啊?为什么微软专家给一个4x5的只读小表建64个Index(完全相同的)?
相关话题的讨论汇总
话题: index话题: alter话题: clustered话题: create话题: rebuild
进入Database版参与讨论
1 (共1页)
a*******t
发帖数: 891
1
According to BOL, TechNet etc,
Alter Index Rebuild = Drop index and Create index
But after I drop an index, it takes 2 hours to create index
whereas Alter Index Rebuild take 15 mins.
Why???
j*******7
发帖数: 6300
2
Did you create the clustered index first?
a*******t
发帖数: 891
3
There are no clustered index on the tabled I tried.
I tested on 1 of the 20 or so non-clustered indexes.

【在 j*******7 的大作中提到】
: Did you create the clustered index first?
gy
发帖数: 620
4
你的次序是: 先DROP + create, 然后再 Alter??

【在 a*******t 的大作中提到】
: According to BOL, TechNet etc,
: Alter Index Rebuild = Drop index and Create index
: But after I drop an index, it takes 2 hours to create index
: whereas Alter Index Rebuild take 15 mins.
: Why???

a*******t
发帖数: 891
5
yes.
I am thinking the alter index rebuild doesn't actually drop the index, it
scans and don't touch the pages if it's still good?

【在 gy 的大作中提到】
: 你的次序是: 先DROP + create, 然后再 Alter??
w*******e
发帖数: 1622
6
呵呵, 你难道没看出gy问你次序的原因吗??

【在 a*******t 的大作中提到】
: yes.
: I am thinking the alter index rebuild doesn't actually drop the index, it
: scans and don't touch the pages if it's still good?

a*******t
发帖数: 891
7
day 1, drop, create, 2 hr
day 2, alter index rebuilt, 15 min
day 3, drop, create, 2 hr
no data change in between
and keywords in my original post: according to BOL and TechNet, alter index
rebuild = drop + create

【在 w*******e 的大作中提到】
: 呵呵, 你难道没看出gy问你次序的原因吗??
j*******7
发帖数: 6300
8
也许逻辑上等价,但rebuild实际上并行建立那些index,而drop+create是串行执行?值
得研究。
Also I find the BOL says there are log differences per recovery models and per different index operations.
gy
发帖数: 620
9
这个,,,,看来还有其他什么解释吧?
zenny??

index

【在 a*******t 的大作中提到】
: day 1, drop, create, 2 hr
: day 2, alter index rebuilt, 15 min
: day 3, drop, create, 2 hr
: no data change in between
: and keywords in my original post: according to BOL and TechNet, alter index
: rebuild = drop + create

z***y
发帖数: 7151
10
When you alter clustered index, all non-clustered indexes will repointed to
new clustered index. Also since we only alter clustered index database
engine will not spend time inventory the existing constraints--they will be
left untouched.
However, when you drop the clustered index, all indexes(clustered and non
clustered) are gone. All constraints will be modified/removed.
Actually my first statement is not 100% correct I just realized... it is
true that non clustered indexes will not be dropped
1 (共1页)
进入Database版参与讨论
相关主题
为什么微软专家给一个4x5的只读小表建64个Index(完全相同的)?mysql rebuild index very slow
关于MSSQL, 问几个比较土的问题Oracle Group and Index question
高手请指点: How to query specific data in all columns efficiently请教 sql server index问题
这个cassandra paging的解决方案怎么样? (转载)mysql 如何更新一个表的index啊?
SQL 2000 create index 問題When should I reorganize Index/Rebuuild Index?
被人鄙视了MS SQL怎么加conditional check
How to make import (>200M) faster?骑驴找马记
indexing就是设置primary key吗?how to remove fulltext index?
相关话题的讨论汇总
话题: index话题: alter话题: clustered话题: create话题: rebuild