Skip to content

Commit 41b53e8

Browse files
Reformat and fix example query
1 parent 1cecb2b commit 41b53e8

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

docs/relational-databases/indexes/get-started-with-columnstore-for-real-time-operational-analytics.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,14 @@ The default value of `COMPRESSION_DELAY` option should work for most customers.
215215
For advanced users, we recommend running the following query and collect % of deleted rows over the last seven days.
216216

217217
```sql
218-
SELECT row_group_id,cast(deleted_rows as float)/cast(total_rows as float)*100 as [% fragmented], created_time
218+
SELECT row_group_id,
219+
CAST(deleted_rows AS float)/CAST(total_rows AS float)*100 AS [% fragmented],
220+
created_time
219221
FROM sys.dm_db_column_store_row_group_physical_stats
220-
WHERE object_id = object_id('FactOnlineSales2')
221-
AND
222-
state_desc='COMPRESSED'
223-
AND
224-
deleted_rows > 0
225-
AND
226-
created_time > GETDATE() - 7
222+
WHERE object_id = OBJECT_ID('FactOnlineSales2')
223+
AND state_desc = 'COMPRESSED'
224+
AND deleted_rows > 0
225+
AND created_time > DATEADD(day, -7, GETDATE())
227226
ORDER BY created_time DESC;
228227
```
229228

0 commit comments

Comments
 (0)