Rebuild Index Task (Maintenance Plan)
Applies to: SQL Server (all supported versions)
Use the Rebuild Index Task dialog to re-create the indexes on the tables in the database with a new fill factor. The fill factor determines the amount of empty space on each page in the index, to accommodate future expansion. As data is added to the table, the free space fills because the fill factor is not maintained. Reorganizing data and index pages can re-establish the free space.
The Rebuild Index Task uses the ALTER INDEX statement. For more info about the options described on this page, see ALTER INDEX (Transact-SQL).
Select the server connection to use when performing this task.
Create a new server connection to use when performing this task. The New Connection dialog box is described below.
Specify the databases affected by this task.
Generate a maintenance plan that runs maintenance tasks against all SQL Server databases except tempdb.
All system databases
Generate a maintenance plan that runs maintenance tasks against each of the SQL Server system databases except tempdb. No maintenance tasks are run against user-created databases.
All user databases
Generate a maintenance plan that runs maintenance tasks against all user-created databases. No maintenance tasks are run against the SQL Server system databases.
These specific databases
Generate a maintenance plan that runs maintenance tasks against only those databases that are selected. At least one database in the list must be selected if this option is chosen.
Maintenance plans only run against databases set to compatibility level 80 or higher. Databases set to compatibility level 70 or lower are not displayed.
Limit the Selection grid to display tables, views, or both.
Specify the tables or indexes affected by this task. Not available when Tables and Views is selected in the Object box.
Default free space per page
Drop the indexes on the tables in the database and re-create them with the fill factor that was specified when the indexes were created.
Change free space per page to
Drop the indexes on the tables in the database and re-create them with a new, automatically calculated fill factor, thereby reserving the specified amount of free space on the index pages. The higher the percentage, the more free space is reserved on the index pages, and the larger the index grows. Valid values are from 0 through 100.
Sort results in tempdb
SORT_IN_TEMPDB option, which determines where the intermediate sort results, generated during index creation, are temporarily stored. If a sort operation is not required, or if the sort can be performed in memory, the
SORT_IN_TEMPDBoption is ignored.
Specify index padding
Keep index online
ONLINE option which allows users to access the underlying table or clustered index data and any associated nonclustered indexes during index operations.
Online index operations are not available in every edition of Microsoft SQL Server. For a list of features that are supported by the editions of SQL Server, see Features Supported by the Editions of SQL Server 2016.
Do not rebuild indexes | Rebuild indexes offline
Specify what to do for index types that cannot be rebuilt while they are online.
Specify a value to limit the number of processors used in a parallel plan execution.
Low Priority Used
Select this option to wait for low priority locks.
Abort after Wait
Specify what to do after the time specified by Max Duration has elapsed.
Specify how long to wait for low priority locks.
View the Transact-SQL statements performed against the server for this task, based on the selected options.
When the number of objects affected is large, this display can take a considerable amount of time.
Index stats options
In earlier versions of Microsoft SQL Server it could cause system slowdown to reorganize or rebuild a large index. SQL Server 2016 implemented major performance improvements for these index operations.
Also, in earlier versions the granularity of control was less refined. This caused the system to reorganize or rebuild some indexes even when the indexes were not much fragmented, which was wasteful. Newer controls on the Maintenance Plan user interface (UI) enable you to exclude indexes which do not need to be refreshed, based on index statistics criteria. For this the following dynamic management views (DMVs) of Transact-SQL are used internally:
The system must consume resources to gather index statistics. You can choose between consuming relatively less or more resources depending on how much precision you feel is needed for index statistics. The UI offers the following list of precision levels from which you must choose one:
Optimize index only if:
The UI offers the following tuneable filters that you can use to avoid refreshing indexes which do not yet strongly need refreshing:
- Fragmentation > (%)
- Page Count >
- Used in last (days)
New Connection Dialog Box
Enter a name for the new connection.
Select or enter a server name
Select a server to connect to when performing this task.
Refresh the list of available servers.
Enter information to log on to the server
Specify how to authenticate against the server.
Use Windows integrated security
Connect to an instance of the SQL Server Database Engine with Windows Authentication.
Use a specific user name and password
Connect to an instance of the SQL Server Database Engine using SQL Server Authentication. This option is not available.
Provide a SQL Server login to use when authenticating. This option is not available.
Provide a password to use when authenticating. This option is not available.
ALTER INDEX (Transact-SQL)
DBCC DBREINDEX (Transact-SQL)
CREATE INDEX (Transact-SQL)
SORT_IN_TEMPDB Option For Indexes
Guidelines for Online Index Operations
How Online Index Operations Work
Perform Index Operations Online
Submit and view feedback for