You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/relational-databases/indexes/reorganize-and-rebuild-indexes.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,14 +89,14 @@ The result set returned by `sys.dm_db_column_store_row_group_physical_stats` inc
89
89
|`total_rows`| Number of rows physically stored in the row group. For compressed row groups, this includes the rows that are marked as deleted. |
90
90
|`deleted_rows`| Number of rows physically stored in a compressed row group that are marked for deletion. 0 for row groups that are in delta store. |
91
91
92
-
To determine the total number of physically stored deleted rows for a nonclustered columnstore index, add the value in the `deleted_rows` column in `sys.dm_db_column_store_row_group_physical_stats` to the value in the `rows` column in [sys.internal_partitions](../system-catalog-views/sys-internal-partitions-transact-sql.md) for the internal object type `COLUMN_STORE_DELETE_BUFFER` and the same object, index, and partition.
93
-
94
92
Compressed row group fragmentation in a columnstore index can be computed using this formula:
To determine the total number of physically stored deleted rows for a nonclustered columnstore index, add the value in the `deleted_rows` column in `sys.dm_db_column_store_row_group_physical_stats` to the value in the `rows` column in [sys.internal_partitions](../system-catalog-views/sys-internal-partitions-transact-sql.md) for the internal object type `COLUMN_STORE_DELETE_BUFFER` and the same object, index, and partition. For an example, see [Check the fragmentation of a columnstore index](#check-the-fragmentation-of-a-columnstore-index).
99
+
100
100
> [!TIP]
101
101
> For both rowstore and columnstore indexes, review index or heap fragmentation and page density after a large number of rows is deleted or updated. For heaps, if there are frequent updates, review fragmentation periodically to avoid proliferation of forwarding records. For more information about heaps, see [Heaps (Tables without Clustered Indexes)](../../relational-databases/indexes/heaps-tables-without-clustered-indexes.md#heap-structures).
102
102
@@ -297,7 +297,7 @@ For an [!INCLUDE [ssazuresynapse-md](../../includes/ssazuresynapse-md.md)] table
297
297
298
298
## Examples
299
299
300
-
### Check the fragmentation and page density of a rowstore index using [!INCLUDE [tsql](../../includes/tsql-md.md)]
300
+
### Check the fragmentation and page density of a rowstore index
301
301
302
302
The following example determines the average fragmentation and page density for all rowstore indexes in the current database. It uses the `SAMPLED` mode to return actionable results quickly. For more accurate results, use the `DETAILED` mode. This requires scanning all index pages, and can take a long time.
For more information, see [sys.dm_db_index_physical_stats](../../relational-databases/system-dynamic-management-views/sys-dm-db-index-physical-stats-transact-sql.md).
335
335
336
-
### Check the fragmentation of a columnstore index using [!INCLUDE [tsql](../../includes/tsql-md.md)]
336
+
### Check the fragmentation of a columnstore index
337
337
338
338
The following example determines the average fragmentation for all columnstore indexes with compressed row groups in the current database.
0 commit comments