Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Indexes and Fragmentation in SQL Server 2000 Part 1


Indexes and Fragmentation in SQL Server 2000 Part 1

Author
Message
Joe Doherty-260822
Joe Doherty-260822
SSC Journeyman
SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)

Group: General Forum Members
Points: 77 Visits: 180
Comments posted here are about the content posted at temp
Koby BILLER
Koby BILLER
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 1
Joe,
Thank you for the excellant article.
When I wrote a year ago my article about fragmentation, this is exactly what I had in mind - but since I am not an SQL expert, I could not do it myself.
Please read my article at http://www.sqlservercentral.com/columnists/kbiller/performancemonitoringbyinternalfragmentationmeasur.asp
and look at www.disklace.com where I present the fragmentation measurement model. This model is working for more than 100,000 users, and proves to be accurate. If you want to join forces and give the audience of this forum a solution - I am ready.
Koby Biller
Koby@disklace.com
MikeTomkies
MikeTomkies
SSC Veteran
SSC Veteran (215 reputation)SSC Veteran (215 reputation)SSC Veteran (215 reputation)SSC Veteran (215 reputation)SSC Veteran (215 reputation)SSC Veteran (215 reputation)SSC Veteran (215 reputation)SSC Veteran (215 reputation)

Group: General Forum Members
Points: 215 Visits: 83
Thanks for the article cant wait for the next instalment. One thing that has confused me over the years is how sql stores and organises text data. You do not include this type of data field in your table,is their a reason for this? if you can just explain about text data as i find you explinations so far very easy to understand.



PaulSp
PaulSp
SSC-Enthusiastic
SSC-Enthusiastic (125 reputation)SSC-Enthusiastic (125 reputation)SSC-Enthusiastic (125 reputation)SSC-Enthusiastic (125 reputation)SSC-Enthusiastic (125 reputation)SSC-Enthusiastic (125 reputation)SSC-Enthusiastic (125 reputation)SSC-Enthusiastic (125 reputation)

Group: General Forum Members
Points: 125 Visits: 286

Hi Joe

I really enjoyed this article. I am not a SQL expert in any way, and found the step by easy step approach excellent. I really feel I have learned something and time spent here was very worthwhile. I look forward to the next article - particularly with a view towards indexes.

Many thanks for the time you spent on this.

Paul


Cory E.
Cory E.
Right there with Babe
Right there with Babe (729 reputation)Right there with Babe (729 reputation)Right there with Babe (729 reputation)Right there with Babe (729 reputation)Right there with Babe (729 reputation)Right there with Babe (729 reputation)Right there with Babe (729 reputation)Right there with Babe (729 reputation)

Group: General Forum Members
Points: 729 Visits: 10845
Very nice - I have learned a lot, cannot wait till the next article.

-- Cory
Ravi Prashanth Lobo-275382
Ravi Prashanth Lobo-275382
SSC Rookie
SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)

Group: General Forum Members
Points: 34 Visits: 1
Good article, To the point. Cleared the basics! Keep up the good work.
Billy Eastwood
Billy Eastwood
SSC Rookie
SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)

Group: General Forum Members
Points: 35 Visits: 5

How this relates to the real world is this...

1) No clustered Index = A Heap

2) Add some Non-clustered indexes to a table and you still have a heap

3) Add more data with the non-clustered indexes and your heaped table will GROW by leaps and bounds !!

4) You want to make the table smaller BUT a heap cannot be defragged! (nothing works, DBCC indexdefrag etc..)

5) You MUST create a clustered index to force defragmentation

Moral - NEVER create non-clustered indexes without creating a clustered index first!

I have come across this knowledge through evaluation of a legacy database which is massive for apparently no reason. I could not shrink its size no matter what I did. Only after much reading did I come across the "Heap Gem" of knowledge and was able to cut the DB down to 40% of its original size by adding, yes adding, clustered indexes to the top 30 largest tables. There were hundreds of tables, dunno what would have happened by adding a CI to all appropriate tables.

- B


PaulSp
PaulSp
SSC-Enthusiastic
SSC-Enthusiastic (125 reputation)SSC-Enthusiastic (125 reputation)SSC-Enthusiastic (125 reputation)SSC-Enthusiastic (125 reputation)SSC-Enthusiastic (125 reputation)SSC-Enthusiastic (125 reputation)SSC-Enthusiastic (125 reputation)SSC-Enthusiastic (125 reputation)

Group: General Forum Members
Points: 125 Visits: 286

Hi Billy

Great additional help to Joe's article.

Thanks for this.

Paul


Charles Kincaid
Charles Kincaid
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1119 Visits: 2383

Great article Joe. Thanks a bunch. Your take on extent switching was new to me. I'm in hopes that the rest of your series will help clear up a mystery for us.

Billy, I agree with you. This goes into our mystery. One table with less than 100 thousand rows had sporadic inserts take MINUTES to complete. The majority of inserts take fractions of seconds. All DBCC indications were clean. Re-index had been done and still it happened. A specific insert would hang. If you drop the row and re-run that specific insert would take long.

In frustration I advised the guy working the problem to drop all the indexes and recreate them. Most are non-clustered and the clustered is PK on the identity column. Dropping the clustered index took 20 minutes. Re-creating the indexes seems to have fixed the problem.

What the ...?



ATBCharles Kincaid
Joe Doherty-260822
Joe Doherty-260822
SSC Journeyman
SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)

Group: General Forum Members
Points: 77 Visits: 180

Mike,

I'll make sure information on all data types is included within this series. Thanks for your input.

Thanks to everyone who has contributed and shown an interest.

Joe


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