Author |
Topic |
inbs
Aged Yak Warrior
860 Posts |
Posted - 2010-09-05 : 12:28:20
|
1.if i create and drop index how is it impact of my preforamce? (i need to check the best index to the table,and i do not have development server)2.indexes need pk on table?(is it make better of performace?) |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
inbs
Aged Yak Warrior
860 Posts |
Posted - 2010-09-05 : 15:22:13
|
tkizeri use standard edition,so what i need to do?our system is BI (so wht i have PK) |
|
|
jeffw8713
Aged Yak Warrior
819 Posts |
Posted - 2010-09-05 : 16:18:35
|
When you create the index, the system will be affected due to the increased IO needed to read the data and build the index. The build of the index will not block any users or other processes.When you drop the index, you could block users - or the drop will be blocked because the index has to be locked before it can be dropped. This could cause all kinds of issues with your system - and really should be performed during a maintenance window.Take Tara's advice - get a copy of the developers edition ($50 US, or less), install on your workstation and test it there first.JeffP.S. Enterprise Edition would not make any difference here, since you are not looking at rebuilding indexes online/offline. |
|
|
inbs
Aged Yak Warrior
860 Posts |
Posted - 2010-09-06 : 02:16:06
|
create and drop index impact on fragmentation? |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-09-06 : 03:48:19
|
Same as rebuilding the index--Gail ShawSQL Server MVP |
|
|
inbs
Aged Yak Warrior
860 Posts |
Posted - 2010-09-06 : 05:22:57
|
how to solve fragmentation?how i know if i have fragmentation? |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-09-06 : 06:29:07
|
http://www.google.com/search?q=index+fragmentation+%22sql+server%22--Gail ShawSQL Server MVP |
|
|
denis_the_thief
Aged Yak Warrior
596 Posts |
Posted - 2010-09-07 : 14:14:23
|
quote: 2.indexes need pk on table?(is it make better of performace?)
A PK is also an index. Indexes (both PKs and other indexes) slow down a little Inserts, Updates and Deletes. But speed up Selects a lot.Indexes do not require a PK on the table. FKs (Foreign Keys) require a PK on the table. |
|
|
denis_the_thief
Aged Yak Warrior
596 Posts |
Posted - 2010-09-07 : 15:24:56
|
quote: how i know if i have fragmentation?
SELECT top 500 (select OBJECT_NAME(i.object_id) from sys.indexes i where i.object_id = phystat.object_id AND i.index_id = phystat.index_id ) Table_Name, (select i.name from sys.indexes i where i.object_id = phystat.object_id AND i.index_id = phystat.index_id ) Index_Name, phystat.avg_fragmentation_in_percent, * FROM sys.dm_db_index_physical_stats(14, NULL, NULL, NULL, Default) phystatwhere Page_count > 1000 order by fragment_count desc The 14 in this case is the Database ID. You should also run the Query in this Database.I have 'where Page_Count > 1000' to ignore the smaller tables. |
|
|
denis_the_thief
Aged Yak Warrior
596 Posts |
|
|