|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, June 07, 2013 2:47 PM
Points: 108,
Visits: 362
|
|
Some Questions about Create index ... with Drop_Existing
1) in case of Create Clustered index ... with Drop_existing=on non-clustered indexes are rebuilt only once using this option or not at all if the key definition is the same.Is this done by creating another copy of the clustered index(and keeping the old one until the new clustered index is created) or it places some locks on the non-clustered index and defers rebuilding that (if necessary) until the new clustered index is created?
2)in case of Create Non-Clustered index ... with Drop_existing=on what does it exactly do?are users able to use the non-clustered index during build process?
Cheers , Pooyan D ________________________________________________ Microsoft Certified Technology Specialist : SQL Server 2008
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Yesterday @ 9:49 AM
Points: 13,436,
Visits: 25,281
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, June 07, 2013 2:47 PM
Points: 108,
Visits: 362
|
|
So there's no difference between using DROP_EXISTING=ON,ONLINE=OFF and dropping and recreating a non-Clustered index .Is there?
Cheers , Pooyan D ________________________________________________ Microsoft Certified Technology Specialist : SQL Server 2008
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 1:57 PM
Points: 38,092,
Visits: 30,387
|
|
Other than that with drop.. create there's potential for queries to use the table between the drop and the create, no.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, June 07, 2013 2:47 PM
Points: 108,
Visits: 362
|
|
Thanks
Cheers , Pooyan D ________________________________________________ Microsoft Certified Technology Specialist : SQL Server 2008
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Yesterday @ 12:12 PM
Points: 320,
Visits: 1,916
|
|
Grant Fritchey (8/17/2012) Drop does exactly what it says. It's going to drop the existing index and then rebuild it. No, it won't leave the existing index available while it does the rebuild... unless you're also doing ONLINE operations with the index. Then the other index will stay in place while the create operation occurs. This will take extra tempdb space, so be ready for that.
Can u rebuild index online? I thought index rebuild must be offline, index reorg is done online. Please advise.
Thanks, SueTons
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 1:57 PM
Points: 38,092,
Visits: 30,387
|
|
Sure you can. Use the ONLINE keyword when rebuilding the index.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|