IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Can you temporarily suspend index updates in SQL Server?
We need to do bulk inserts and updates to a very large table. The update in particular is getting very slow.

I know it's possible to drop an index, do the update, then rebuild the index, but we need the DB to remain available during the process. (We're working toward replication/load balancing so that this is no longer true.)

Is it possible to temporarily suspend updating the index until after the batch update, then reindex all at once?
--

Drew
New Can you drop the index before the activity?
New Mentioned that
The table needs to remain available during the process. Yes, it would be much better if we could take it offline, but until we get replication/load balancing working, it needs to stay up.
--

Drew
New Confused
Does the table access REQUIRE the index?
New Only if we want it to not suck
This is multiple millions of records, and we're searching on it constantly. If we drop all indices for several minutes while we do bulk updates, it's the same as being offline for that amount of time, isn't it? Unless we're assuming very different things.
--

Drew
New Nope, we are in agreement
Does this work for you?

http://blog.sqlautho...ndex-alter-index/
New That's it
I knew there was a command for it. We'll need to understand the ramifications of course, but that's exactly what I was looking for. Thanks.
--

Drew
New Enjoy
New Not the word I'd use :-D
--

Drew
New using BulkCopy bcp program?
My references are from Sybase, but I'm 90% it's identical to MS-SQL.

Use BulkCopy with a blocking factor - I recommend 5000 but it'll depend on your logspace.

Don't forget to run an update statistics...if I recall correctly, that's a no-load operation.
New oh, and I'd check to see if you could turn replication off
(speaking as someone who's filled the replication logs before).
New This isn't (currently) replicated
If it were, this would be a non-issue. In the future, we plan to have multiple slaves. Then we just drop the master from the load balancer and do the update. Drop one slave and kick off replication. Put that slave back in, drop and replicate the next. Repeat as necessary.

This is a mostly read-only DB. We need to do bulk insert/update operations. Currently we do the update in a DEV environment, then move the changes up to PROD.

What I'm looking at now are the issues around simply copying the files and doing a detach/attach on PROD. If that's a fast operation, with a small chance of failing, and high confidence in rolling back to the old version if it fails, that might be the way to go.
--

Drew
     Can you temporarily suspend index updates in SQL Server? - (drook) - (11)
         Can you drop the index before the activity? -NT - (crazy) - (7)
             Mentioned that - (drook) - (6)
                 Confused - (crazy) - (5)
                     Only if we want it to not suck - (drook) - (4)
                         Nope, we are in agreement - (crazy) - (3)
                             That's it - (drook) - (2)
                                 Enjoy -NT - (crazy) - (1)
                                     Not the word I'd use :-D -NT - (drook)
         using BulkCopy bcp program? - (S1mon_Jester) - (2)
             oh, and I'd check to see if you could turn replication off - (S1mon_Jester) - (1)
                 This isn't (currently) replicated - (drook)

Mercy is the mark of a great man. [stabs Atherton] Guess I'm just a good man. [stabs Atherton again] Well, I'm all right.
123 ms