Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesIf I need to add indexes to a large number of SQL Server 2005 tables/databases tables, can I do it during the day when the database is in use? Or is this something that I should do after hours? Adding and dropping indexes seems pretty benign (assuming you pick the right fields), but I'm new at this, if you can't tell. Thanks!
Post Follow-up to this messageYou can add indexes using the ONLINE option (some restrictions, see Books On line, the updated version, CREATE INDEX). ONLINE mean that SQL Server will not acquire a lock on the data while the index is added. ONLINE is only available on Enterprise Edition. If you don't use ONLINE, the table will be locked by shared lock if you crea te non-clustered index, or exclusive lock if you create clustered index. This will obviously have an impact of those who try to access the tables while the index is being created. Apart from the locking and blocking situation, the will be an obvious resour ce usage while the index is being created. -- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www. solidqualitylearning .com/ Blog: http:// solidqualitylearning .com/blogs/tibor/ "Chris Huddle" < chuddle@NOSPAMtimepl us.com> wrote in message news:OMlTwkAWGHA.5148@TK2MSFTNGP12.phx.gbl... > If I need to add indexes to a large number of SQL Server 2005 tables/data bases tables, can I do > it during the day when the database is in use? Or is this something that I should do after hours? > Adding and dropping indexes seems pretty benign (assuming you pick the rig ht fields), but I'm new > at this, if you can't tell. Thanks! >
Post Follow-up to this messageummm, adding indexes during the day pretty much locks out the users from accessing that table while the indexes are being made. if the users don't mind, then neither do I !!!!!!!!!!
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread