What is the difference between OFFLINE and ONLINE index rebuild in SQL Server?

前端 未结 3 767
遥遥无期
遥遥无期 2021-02-01 12:30

When rebuilding an index, there is an option for ONLINE=OFF and ONLINE=ON. I know that when ONLINE mode is on, it makes a copy of the index, switches new queries to utilizing it

3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-01 13:01

    The main differences are:

    1) OFFLINE index rebuild is faster than ONLINE rebuild.

    2) Extra disk space required during SQL Server online index rebuilds.

    3) SQL Server locks acquired with SQL Server online index rebuilds.

    • This schema modification lock blocks all other concurrent access to the table, but it is only held for a very short period of time while the old index is dropped and the statistics updated.

提交回复
热议问题