SQL Server Database Table Fragmentation


How do you minimize the amount of fragmentation on your database tables that are heavily used?

I have an online SQL Server 2008 (SP2)supported application, the database has two tables that shows heavy reads/write and delete. Due to the read/write and deletes, the columns becomes easily fragemented.  However, I tend to rebuild the indexes very often, but the more I rebuild the more fragmented the indexes.  So, can somebody tell exactly what I needed to do if possible to minimize the level of fragmentation on these tables?
FavorableAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TempDBACommented:
fillfactor is something you can consider here. If the table is updated,deleted frequently , it is good you keep the fillfactor to 50 while creating index.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
FavorableAuthor Commented:
Can you show me the steps?
0
TempDBACommented:
its easy. just while rebuilding your index include the option.

alter index <indexname> on <tablename>
rebuild with (online = on,maxdop = 0, fillfactor = 50)

Online option will let you rebuild your index online without Locking the full table so that there is basically no downtime.
Maxdop allows you to set the degree of parallelism you want to use for rebuilding the index.
fillfactor will be used while feeling up the index page. 50 means half of the page will be filled and half will be left empty for transactions.
0
FavorableAuthor Commented:
accepted
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.