I would like to rebuild indexes.Will the tables be automatically available for use available once the rebuild completes or do I have to do anything to make them available?I am thinking of creating a maintenance plan in MS SQL server management studio to rebuild indexes.I have come across 2 different thoughts regarding rebuilding indexes and updating statistics .One thought says updating statistics is not necessary after rebuilding statistics as a rebuild automatically updates statistics and another thought says we need to update statistics.Under what circumstances do these 2 different thoughts hold true?
I ran this query:Select
default, default, default, default) ips
INNER JOIN sys.indexes i
ON ips.index_id = i.index_id AND
ips.object_id = i.object_id
ips.object_id > 99 AND
ips.avg_fragmentation_in_percent >= 10
--ips.index_id > 0
order by ips.avg_fragmentation_in_percent desc
which gave the list of object names with their fragmentation.But when I actually see their fragmentation levels in Management studio it says a different story.The results hardly match with a wide variation
Ex:Query says 99% fragmented on the objects but the management studio says 2%.
Which one should I trust?And what should I do to make these 2 match in the database?