Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 5123

is it safe to rename index while DB is on-line?

$
0
0

Hi,

We need to replace one index with another. Both indexes are similar (index columns are the same) except new index has one  included column. System must remain on-line while index is replaced/recreated

Initial approach was to drop old index and create new one. That would take about 50 seconds. Objective is to decrease that time. New idea would be to create new index then drop old one and rename new one to have old one's name. Steps:

1) Create new index, let's call it MY_INDEX_1

2) Drop old index named MY_INDEX

3) rename MY_INDEX_1 to MY_INDEX

I suppose renaming will be done instantly but still have to check if any issues can be expected? For instance, once new index is created, some query uses it in exec plan and we rename index in that particular moment, can we expect some trouble?

Thanks in advance!


Viewing all articles
Browse latest Browse all 5123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>