You are here: Re: Bizarre slow query problem (again) « MsSQL Server « IT news, forums, messages
Re: Bizarre slow query problem (again)

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация