Skip to content

Commit 8c4b962

Browse files
authored
Merge pull request #33650 from cbenkler/patch-1
Adding note for case of stats update on 0 rowcount table to both UPDATE stats and CREATE stats docs
2 parents b188961 + 4d17e98 commit 8c4b962

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/t-sql/statements/create-statistics-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ In [!INCLUDE [fabricdw](../../includes/fabric-dw.md)] in [!INCLUDE [fabric](../.
196196
When `ON`, the statistics retain the creation sampling percentage for subsequent updates that don't explicitly specify a sampling percentage. When `OFF`, statistics sampling percentage gets reset to default sampling in subsequent updates that don't explicitly specify a sampling percentage. The default is `OFF`.
197197

198198
> [!NOTE]
199-
> If the table is truncated, all statistics built on the truncated HoBT will revert to using the default sampling percentage.
199+
> If the table is truncated, all statistics built on the truncated heap or B-tree (HoBT) will revert to using the default sampling percentage. Similarly, if statistics are updated on an object with no rows, it reverts to using the default sampling percentage even if `PERSIST_SAMPLE_PERCENT` was previously configured.
200200
201201
#### STATS_STREAM = *stats_stream*
202202

docs/t-sql/statements/update-statistics-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ When `ON`, the statistics will retain the set sampling percentage for subsequent
160160

161161
If `AUTO_UPDATE_STATISTICS` is executed, it uses the persisted sampling percentage if available, or use default sampling percentage if not. `RESAMPLE` behavior isn't affected by this option.
162162

163-
If the table is truncated, all statistics built on the truncated heap or B-tree (HoBT) will revert to using the default sampling percentage.
163+
If the table is truncated, all statistics built on the truncated heap or B-tree (HoBT) will revert to using the default sampling percentage. Similarly, if statistics are updated on an object with no rows, it reverts to using the default sampling percentage even if `PERSIST_SAMPLE_PERCENT` was previously configured.
164164

165165
> [!NOTE]
166166
> In [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)], when rebuilding an index which previously had statistics updated with `PERSIST_SAMPLE_PERCENT`, the persisted sample percent is reset back to default. Starting with [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] SP2 CU17, [!INCLUDE [ssSQL17](../../includes/sssql17-md.md)] CU26, and [!INCLUDE [sssql19-md](../../includes/sssql19-md.md)] CU10, the persisted sample percent is kept even when rebuilding an index.

0 commit comments

Comments
 (0)