Showing posts with label moved. Show all posts
Showing posts with label moved. Show all posts

Thursday, March 29, 2012

Does SQL Server move records between partitions when updating the partition key column?

If I run an UPDATE query on a table which is partitioned by the column I am updating - will the records be moved to another partition?

ie. I have a table where Historical bit column marks whether a particular record should go to Partition1 (=0) or Partition2 (=1). Now, I update a record in that table and change the Historical column value from 0 to 1. What happens with that record?

It will move to the other partition.

Thanks,|||Thank you. That's the kind of behavior I was looking for.

Sunday, March 11, 2012

Does it take longer to restore the first time?

We moved a 2000 database to another platform by restoring the database. It took a lot longer than I expected. Would it take less time to restore it a second time to the same target database since the allocations are already there?

Thanks

I really doubt it because the files will still need to be extracted from the backup file and those files allocated on the disk. The OS will likely see the files as totally new files and allocate space for them again. If you are using 2005, you have the option for fast recovery, which allows the database to be online while the data is being restored.