Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Re-Indexing a large table Expand / Collapse
Author
Message
Posted Thursday, August 21, 2014 12:18 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Sunday, September 14, 2014 11:43 PM
Points: 79, Visits: 151
I need to reorg/rebuild the indexes on a large table (8.7 billion rows of data), should I rebuild the clustered index first or the non-clustered indexes first, or does it not matter?

Thanks,
Post #1605668
Posted Thursday, August 21, 2014 1:18 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 3:43 PM
Points: 43,047, Visits: 36,206
Doesn't matter at all (providing you aren't using SQL 2000)


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

Post #1605684
Posted Thursday, August 21, 2014 1:29 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Sunday, September 14, 2014 11:43 PM
Points: 79, Visits: 151
Thanks Gail, that helps with the order of operations :)

Is there some literature I can read up on that explains why it doesn't matter?

Thanks Again.

-Tom
Post #1605687
Posted Thursday, August 21, 2014 1:53 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Yesterday @ 4:13 AM
Points: 747, Visits: 1,315
This question have been answered over here
Post #1605694
Posted Thursday, August 21, 2014 2:00 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Sunday, September 14, 2014 11:43 PM
Points: 79, Visits: 151
Excellent, thanks very much.
Post #1605695
Posted Thursday, August 21, 2014 2:31 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 3:43 PM
Points: 43,047, Visits: 36,206
ReamerXXVI (8/21/2014)
Is there some literature I can read up on that explains why it doesn't matter?


Order doesn't matter because they're independent operations, they don't interfere or interact with each other, hence it has no difference at all what order you do them



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

Post #1605705
Posted Thursday, August 21, 2014 10:42 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 4:58 PM
Points: 37,107, Visits: 31,664
ReamerXXVI (8/21/2014)
I need to reorg/rebuild the indexes on a large table (8.7 billion rows of data), should I rebuild the clustered index first or the non-clustered indexes first, or does it not matter?

Thanks,


Gail answered the question that you asked.

To simplify and shorten such reindexing of this large table, have you considered either Paritioned Views or Partitioned Tables?


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1606102
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse