SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Create Clustered Index on a Very Large Table (500 GB)


Create Clustered Index on a Very Large Table (500 GB)

Author
Message
Evil Kraig F
Evil Kraig F
SSC-Insane
SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)

Group: General Forum Members
Points: 20659 Visits: 7660
TheSQLGuru (8/7/2014)
I think this is slightly mis-stated Jeff. While you may not get fragmentation from end-of-index inserts, you certainly can get page LATCH contention, which can be a significant bottleneck to good insert performance in such a scenario.


Kevin, won't you get LATCH contention at the Extent tail either way?


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
TheSQLGuru
TheSQLGuru
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32311 Visits: 8674
Evil Kraig F (8/8/2014)
TheSQLGuru (8/7/2014)
I think this is slightly mis-stated Jeff. While you may not get fragmentation from end-of-index inserts, you certainly can get page LATCH contention, which can be a significant bottleneck to good insert performance in such a scenario.


Kevin, won't you get LATCH contention at the Extent tail either way?


Not if you use a non-"tail-end" type key. This is often done in high-volume insert scenarios to spread the latching around the range of values, at least a bit. Hashes or mods or even GUIDs (yes, it hurt just a little bit to say that :w00tSmile can be a win in scenarios like that.

Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
Evil Kraig F
Evil Kraig F
SSC-Insane
SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)

Group: General Forum Members
Points: 20659 Visits: 7660
TheSQLGuru (8/8/2014)
Evil Kraig F (8/8/2014)
TheSQLGuru (8/7/2014)
I think this is slightly mis-stated Jeff. While you may not get fragmentation from end-of-index inserts, you certainly can get page LATCH contention, which can be a significant bottleneck to good insert performance in such a scenario.


Kevin, won't you get LATCH contention at the Extent tail either way?


Not if you use a non-"tail-end" type key. This is often done in high-volume insert scenarios to spread the latching around the range of values, at least a bit. Hashes or mods or even GUIDs (yes, it hurt just a little bit to say that :w00tSmile can be a win in scenarios like that.


Sorry, I wasn't clear. I meant HEAP or tail-end CI would react nearly similarly to my knowledge for hot spot contention.


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (215K reputation)SSC Guru (215K reputation)SSC Guru (215K reputation)SSC Guru (215K reputation)SSC Guru (215K reputation)SSC Guru (215K reputation)SSC Guru (215K reputation)SSC Guru (215K reputation)

Group: General Forum Members
Points: 215540 Visits: 41979
TheSQLGuru (8/7/2014)
I think this is slightly mis-stated Jeff. While you may not get fragmentation from end-of-index inserts, you certainly can get page LATCH contention, which can be a significant bottleneck to good insert performance in such a scenario.


Thanks for the feedback, Kevin. It is certainly possible that I've not worked on a system that has had a high enough level of tail-end inserts to matter. Expedia.com (we took care of the "yellow box" adds at the top and the bottom) was the biggest I've worked on and the number of inserts weren't what I'd call huge (just a couple of hundred every couple of seconds). That's also where the incident with the application timeouts due to page splits on an NCI with low selectivity occurred and that's what I was basing my comment on. It was amazing just how quickly it happend. As soon as the index committed, WHAM! As soon as we dropped the index, the problem went away just as quickly. The table did have a CI on an IDENTITY column.

--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.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
SQLnbe
SQLnbe
SSC-Enthusiastic
SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)

Group: General Forum Members
Points: 121 Visits: 67
Hey guys, sorry I'm a bit late on this but I had a question in regards the Online re-indexing in Enterprise. Does the ONLINE=ON completely eliminate the possibility of Table Locks when the process is running or does it just lower the % of that?

Thanks :-)
sql-lover
sql-lover
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4537 Visits: 1930
SQLnbe (8/8/2014)
Hey guys, sorry I'm a bit late on this but I had a question in regards the Online re-indexing in Enterprise. Does the ONLINE=ON completely eliminate the possibility of Table Locks when the process is running or does it just lower the % of that?

Thanks :-)


Maybe you should open a new thread for that? But the answer is no. Still some locks are needed but the operation is less intrusive.

Grab a cup of coffee and read this: How Online Index Operations Work
SQLnbe
SQLnbe
SSC-Enthusiastic
SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)

Group: General Forum Members
Points: 121 Visits: 67
sql-lover (8/8/2014)
SQLnbe (8/8/2014)
Hey guys, sorry I'm a bit late on this but I had a question in regards the Online re-indexing in Enterprise. Does the ONLINE=ON completely eliminate the possibility of Table Locks when the process is running or does it just lower the % of that?

Thanks :-)


Maybe you should open a new thread for that? But the answer is no. Still some locks are needed but the operation is less intrusive.



Ok thanks
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search