Skip to content

Commit e642bfe

Browse files
authored
Update design-guidance-for-replicated-tables.md
1 parent 1d83f99 commit e642bfe

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

articles/synapse-analytics/sql-data-warehouse/design-guidance-for-replicated-tables.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ To trigger a rebuild, run the following statement on each table in the preceding
184184
```sql
185185
SELECT TOP 1 * FROM [ReplicatedTable]
186186
```
187+
187188
> [!NOTE]
188189
> If you are planning to rebuild the statistics of the uncached replicated table, make sure to update the statistics before triggering the cache. Updating statistics will invalidate the cache, so the sequence is important.
189190
>
@@ -197,6 +198,15 @@ SELECT TOP 1 * FROM [ReplicatedTable]
197198
> UPDATE STATISTICS [ReplicatedTable]
198199
> END
199200
> ```
201+
>
202+
> ```sql
203+
> -- Correct sequence. Ensure that the rebuild operation is the last statement within the batch.
204+
> BEGIN
205+
> UPDATE STATISTICS [ReplicatedTable]
206+
>
207+
> SELECT TOP 1 * FROM [ReplicatedTable]
208+
> END
209+
> ```
200210
201211
To monitor the rebuild process, you can use [sys.dm_pdw_exec_requests](/sql/relational-databases/system-dynamic-management-views/sys-dm-pdw-exec-requests-transact-sql?view=azure-sqldw-latest&preserve-view=true), where the `command` will start with 'BuildReplicatedTableCache'. For example:
202212

0 commit comments

Comments
 (0)