We have a Production database and a Test database. When statements are run
in Production they take in excess of 30 hours, however when run in Test
(copied from Production the night before) they only take 11 hours.
I have run a DBCC SHOWCONTIG on the Customer Ledger table and in Production
this is reporting an 88.91 % Extent Scan Fragmentation, however in TEST the
same table only reports a 0.59% frag. I am assuming that this fragmentation
in PROD is greatly contributing to the "slowness" of the statements. I run
Maintenance Plans every weekend for the indexes, but this does not seem to
make any difference, so I am assuming that it is data that is badly
fragmented.
Is the best way to sort this out to copy the data out to a new table and
drop the original and rename it back. Or does anybody else have any
suggestions
Thanks
Simon