SQL Optimization/Maintenance - Reorganize/Rebuild Index Tasks

SQL Optimization/Maintenance - Reorganize/Rebuild Index Tasks

Hey guys,

Having read more about indexes and how it affect performance, I was shocked pulling up stats on one of our main OS databases in developement...

<code to run against DB>

SELECT dbschemas.[name] as 'Schema', 
dbtables.[name] as 'Table', 
dbindexes.[name] as 'Index',
FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) AS indexstats
INNER JOIN sys.tables dbtables on dbtables.[object_id] = indexstats.[object_id]
INNER JOIN sys.schemas dbschemas on dbtables.[schema_id] = dbschemas.[schema_id]
INNER JOIN sys.indexes AS dbindexes ON dbindexes.[object_id] = indexstats.[object_id]
AND indexstats.index_id = dbindexes.index_id
WHERE indexstats.database_id = DB_ID()
ORDER BY indexstats.avg_fragmentation_in_percent desc

</code to run against DB>

There are some serious fragmentation going on, not just in our own tables, but also in OS specific tables (oslog_Error for one).  I got the top 480 tables all above 50% fragmentation, the top 1% is all in the 99.9% fragmentation range...  Top table is 99.9029126213592% fragmented...  Scary

So, after more searching on the web I found the included document.  The document describes a SQL Maintenance plan that includes weekly Reorganize Index and Rebuild Index Tasks.

So my question is this:  Is anyone here using Reorganize/Rebuild Index tasks on their OS DB's?  Any reasons not to use them?  In a DB where the listed amount of indexes are currently reaching almost 3000, this must surely enhance performance levels...

Is there no-one who does Index Maintenance as described?
What would you do if you saw this condition on a non-Outsystems SQL Database?  Do the same thing using the same tools.  The only issue you'll have is if you are using the Peronnal Edition because you don't have access to those tools, but since the database maxes out at 1 GB you shouldn't have an issue.

Hope this helps,