Online Index Insert Operator

Hi Geeks,

SQL Server allows you to create, alter or drop indexes online i.e. while underlying table is available to users. Online index operator implements these operations and is a physical operator.

Let us reproduce this scenario with the help of following query.

USE [AdventureWorks2012]

ALTER INDEX [PK_Address_AddressID]
ON [Person].[Address]
REBUILD WITH (ONLINE= ON)

OnlineIndexInsertGrphPlan

Above plan is self-explanatory, clustered index scan outputs into online index insert operator. Next to that, there is Gather streams operator which only used in parallel plans. This operator consumes several input stream and produce single output by combining all of them.

What happens, if we remove ONLINE = ON option from the ALTER INDEX statement, let’s see.

USE [AdventureWorks2012]

ALTER INDEX [PK_Address_AddressID]
ON [Person].[Address]
REBUILD

OfflineIndexInsertGrphPlan

Online index insert is replaced with Index Insert as can be seen above and rest of the plan remains same.

Happy Learning!

Regards,

Kanchan

Like us on FaceBook | Join the fastest growing SQL Server group on FaceBook | Follow me on Twitter | Follow me on FaceBook

 
Data Platform Virtual Summit 2020

Subscribe to SQLServerGeeks YouTube channel. If you want more learning content in your inbox, subscribe to SQLServerGeeks Bulletin.

SQLServerGeeks YouTube | SQLServerGeeks Bulletin | SQLServerGeeks Twitter

Avatar

About Kanchan Bhattacharyya

Kanchan is an astute IT professional, a seasoned SQL Database Administrator with 13+ years of industry experience. A calculated risk taker with deep technical knowledge and has gained proficiency in database consulting and solutions across different environments. Kanchan holds MBA degree in IT and an International Executive MBA in Project Management. He is very passionate about SQL Server and holds MCSE (Data Platform), MCSA – SQL 2012, MCITP – SQL 2008 certifications. Currently he is focusing on cloud and latest releases of SQL Server. When not working, Kanchan likes to spend his time reading on new technical developments specifically on SQL Server and other related technologies.

View all posts by Kanchan Bhattacharyya →

Leave a Reply

Your email address will not be published. Required fields are marked *