|
Posted by Erland Sommarskog on 01/14/07 10:32
(wizofaus@hotmail.com) writes:
> Well I found another solution - reindex the table.
>
> I ran
>
> dbcc dbreindex('mytable', ' ', 90) on the initial database, and now the
> problem is gone away. My main concern was that if we did see this
> problem occuring in productoion databases, how could we fix it, other
> than changing the code, and at least now I have such a solution, and
> it's a bit less drastic than exporting and re-importing all the data
> (which potentially could have taken hours).
It's recommended to run a maintenance job to reindex the table with some
frequency. The main reason for this is to prevent defragmentation. A side
effect of this is that statistics are updated with fullscan, that is all
rows are considered. That gives the optimizer more accurate information.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|