Section courante

A propos

Section administrative du site

ALTER INDEX

Modifie l'index
  Microsoft SQL Server

Syntaxe

ALTER INDEX { index_name | ALL } ON object
{
REBUILD {
[ PARTITION = ALL ] [ WITH ( rebuild_index_option [ ,...n ] ) ]
| [ PARTITION = partition_number [ WITH ( single_partition_rebuild_index_option ) [ ,...n ] ]
}
| DISABLE
| REORGANIZE [ PARTITION = partition_number ] [ WITH ( reorganize_option ) ]
| SET ( set_index_option [ ,...n ] )
| RESUME [WITH (resumable_index_options,[...n])]
| PAUSE
| ABORT
}
[ ; ]

object ::=
{
{ database_name.schema_name.table_or_view_name | schema_name.table_or_view_name | table_or_view_name }
}

rebuild_index_option ::=
{
PAD_INDEX = { ON | OFF }
| FILLFACTOR = fillfactor
| SORT_IN_TEMPDB = { ON | OFF }
| IGNORE_DUP_KEY = { ON | OFF }
| STATISTICS_NORECOMPUTE = { ON | OFF }
| STATISTICS_INCREMENTAL = { ON | OFF }
| ONLINE = {
ON [ ( low_priority_lock_wait ) ]
| OFF }
| RESUMABLE = { ON | OFF }
| MAX_DURATION = time [MINUTES}
| ALLOW_ROW_LOCKS = { ON | OFF }
| ALLOW_PAGE_LOCKS = { ON | OFF }
| MAXDOP = max_degree_of_parallelism
| DATA_COMPRESSION = { NONE | ROW | PAGE | COLUMNSTORE | COLUMNSTORE_ARCHIVE }
[ ON PARTITIONS ( {partition_number [ TO partition_number] } [ , ...n ] ) ]
}

single_partition_rebuild_index_option ::=
{
SORT_IN_TEMPDB = { ON | OFF }
| MAXDOP = max_degree_of_parallelism
| RESUMABLE = { ON | OFF }
| MAX_DURATION = time [MINUTES}
| DATA_COMPRESSION = { NONE | ROW | PAGE | COLUMNSTORE | COLUMNSTORE_ARCHIVE } }
| ONLINE = { ON [ ( low_priority_lock_wait ) ] | OFF }
}

reorganize_option::=
{
LOB_COMPACTION = { ON | OFF }
| COMPRESS_ALL_ROW_GROUPS = { ON | OFF}
}

set_index_option::=
{
ALLOW_ROW_LOCKS = { ON | OFF }
| ALLOW_PAGE_LOCKS = { ON | OFF }
| OPTIMIZE_FOR_SEQUENTIAL_KEY = { ON | OFF }
| IGNORE_DUP_KEY = { ON | OFF }
| STATISTICS_NORECOMPUTE = { ON | OFF }
| COMPRESSION_DELAY= { 0 | delay [Minutes] }
}

resumable_index_option ::=
{
MAXDOP = max_degree_of_parallelism
| MAX_DURATION =time [MINUTES]
| low_priority_lock_wait
}

low_priority_lock_wait::=
{
WAIT_AT_LOW_PRIORITY ( MAX_DURATION = time [ MINUTES ] ,
ABORT_AFTER_WAIT = { NONE | SELF | BLOCKERS } )
}

Description

Cette instruction permet de modifier une table existante ou index de vue (relationnel ou XML) par désactivation, reconstruction ou réorganisation de l'index.



Dernière mise à jour : Vendredi, le 19 Juin 2020