Solved

Rebuild and Reorganize Index

Posted on 2013-05-13
8
574 Views
Last Modified: 2013-05-16
In SQL 2008, is it necessary to rebuild and reorganize the index under the maintenance Plans.

If so, which one should rebuild periodically?  Should I Rebuild before Reorganizing?  

What is the main difference between these two tasks?  Are there any dangers to doing this?

I will be using the maintenance wizard to implement this, so any advice on the above questions would be helpful.

Thanks
0
Comment
Question by:al4629740
  • 4
  • 2
  • 2
8 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 400 total points
ID: 39163154
Yes you should schedule jobs to do that, I wont recommend maiintenance plans though, use the script mentioned here
http://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html

differene b/w reindex and organie can be found here
http://technet.microsoft.com/en-us/library/ms189858(v=sql.105).aspx
0
 

Author Comment

by:al4629740
ID: 39163216
Why not the maintenance plans?
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 39163227
>Why not the maintenance plans?
You cannot really specify when to go for index reorganise and rebuild. Also i find it really hard to debug. The solution on that link is excellent most of the top SQL gurus uses that.
0
 

Author Comment

by:al4629740
ID: 39163278
Would I run this code without modification?

http://ola.hallengren.com/scripts/IndexOptimize.sql

I am apprehensive about running any scripts that change something that I don't fully understand.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:al4629740
ID: 39163308
Also, in my original question, which would be better to do first?

Reorganize or rebuild?
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 100 total points
ID: 39163507
Would I run this code without modification?
All the code does is create a Stored Procedure called IndexOptimize, it is up to you how you want to execute it.

I am apprehensive about running any scripts that change something that I don't fully understand.
And how is that different from a Maintenance Plan?  Do you have any idea what it is doing?

Also, in my original question, which would be better to do first?
Reorganize or rebuild?

It depends.  You use one or the other not both.  Have you read the link that Aneesh posted on the subject?
0
 

Author Comment

by:al4629740
ID: 39163549
ok.  How does one determine the avg_fragmentation_in_percent
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 39164497
How does one determine the avg_fragmentation_in_percent
It is covered in that same article that Aneesh posted.  Let me know if you are having difficulty reaching that link.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now