when you rebuild or reorganize index?

0 votes
asked Feb 10, 2016 in T-SQL by khushbu (290 points)

1 Answer

0 votes
answered Feb 12, 2016 by darsh (3,020 points)

Rebuilding and Reorganizing of index depends on fragmentation . By using the system function sys.dmdbindexphysicalstats, you can detect fragmentation in a specific index, all indexes on a table or indexed view, all indexes in a database, or all indexes in all databases.
The result set returned by the sys.dmdbindexphysicalstats function includes the following columns.

enter image description here

After the degree of fragmentation is known, use the following table to determine the best method to correct the fragmentation.

enter image description here

  • Rebuilding an index can be executed online or offline. Reorganizing an index is always executed online. To achieve availability similar to the reorganize option, you should rebuild indexes online.
Welcome to I Can Crack, where you can ask questions and receive answers from other members of the community.

68 questions

47 answers

3 comments

5,318 users

...