Workaround
Method 1, rebuild the specified index, this method has no performance to talk about. The table is not yet accessible at rebuild time.
Method 2, rebuild the index online, only supported by SQL Server Enterprise Edition.
Method 3, using fill factor reconstruction, do not necessarily reduce the amount of IO on the search
Method 4, enable the compressed data page. This can reduce the amount of IO on the lookup, but it will be weighed against more CPUs.
--------------------------------------------------------------------------------------------------------------- -----------------------------------------------
Method 1,
Alter INDEX Idx_orderid
ON dbo. OrderDetail
Rebuild
Go
Method 2,
Alter INDEX Idx_orderid
ON dbo. OrderDetail
Rebuild
With (online =on);
Method 3,
Alter INDEX Idx_orderid
ON dbo. OrderDetail
Rebuild
With (FillFactor =-sort_in_tempdb = ON);
Go
Method 4,
Alter INDEX Idx_orderid
ON dbo. OrderDetail
Rebuild
With
(data_compression = Page);
Go
Summary: Alter INDEX all on dbo. TableName rebuild; Use all to rebuild all indexes on the specified table.
4 ways to rebuild SQL Server index