Skip to content

Commit 5ff52e5

Browse files
authored
Merge pull request #109017 from XiaoyuMSFT/ordercci
change example
2 parents a4b3ece + 4e65f7c commit 5ff52e5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

articles/synapse-analytics/sql-data-warehouse/performance-tuning-ordered-cci.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,21 @@ When creating an ordered CCI, the SQL Analytics engine sorts the existing data i
2525
To check the segment ranges for a column, run this command with your table name and column name:
2626

2727
```sql
28-
SELECT o.name, pnp.index_id, cls.row_count, pnp.data_compression_desc, pnp.pdw_node_id,
29-
pnp.distribution_id, cls.segment_id, cls.column_id, cls.min_data_id, cls.max_data_id, cls.max_data_id-cls.min_data_id as difference
28+
SELECT o.name, pnp.index_id,
29+
cls.row_count, pnp.data_compression_desc,
30+
pnp.pdw_node_id, pnp.distribution_id, cls.segment_id,
31+
cls.column_id,
32+
cls.min_data_id, cls.max_data_id,
33+
cls.max_data_id-cls.min_data_id as difference
3034
FROM sys.pdw_nodes_partitions AS pnp
3135
JOIN sys.pdw_nodes_tables AS Ntables ON pnp.object_id = NTables.object_id AND pnp.pdw_node_id = NTables.pdw_node_id
3236
JOIN sys.pdw_table_mappings AS Tmap ON NTables.name = TMap.physical_name AND substring(TMap.physical_name,40, 10) = pnp.distribution_id
3337
JOIN sys.objects AS o ON TMap.object_id = o.object_id
3438
JOIN sys.pdw_nodes_column_store_segments AS cls ON pnp.partition_id = cls.partition_id AND pnp.distribution_id = cls.distribution_id
35-
JOIN sys.columns as cols ON o.object_id = cols.object_id AND cls.column_id = cols.column_id
36-
WHERE o.name = '<Table_Name>' and cols.name = '<Column_Name>'
37-
ORDER BY o.name, pnp.distribution_id, cls.min_data_id
39+
JOIN sys.columns as cols ON o.object_id = cols.object_id AND cls.column_id = cols.column_id
40+
WHERE o.name = '<Table Name>' and cols.name = '<Column Name>' and TMap.physical_name not like '%HdTable%'
41+
ORDER BY o.name, pnp.distribution_id, cls.min_data_id
42+
3843

3944
```
4045

0 commit comments

Comments
 (0)