Skip to content

Latest commit

 

History

History
68 lines (53 loc) · 3.5 KB

File metadata and controls

68 lines (53 loc) · 3.5 KB
title sys.pdw_nodes_partitions (Transact-SQL)
description sys.pdw_nodes_partitions (Transact-SQL)
author WilliamDAssafMSFT
ms.author wiassaf
ms.date 03/03/2017
ms.service sql
ms.subservice data-warehouse
ms.topic reference
dev_langs
TSQL
monikerRange >=aps-pdw-2016||=azure-sqldw-latest

sys.pdw_nodes_partitions (Transact-SQL)

[!INCLUDEapplies-to-version/asa-pdw]

Contains a row for each partition of all the tables, and most types of indexes in a [!INCLUDEssazuresynapse-md] database. All tables and indexes contain at least one partition, whether or not they are explicitly partitioned.

Column name Data type Description
partition_id bigint ID of the partition. Is unique within a database.
object_id int ID of the object to which this partition belongs. Every table or view is composed of at least one partition.
index_id int ID of the index within the object to which this partition belongs.
partition_number int 1-based partition number within the owning index or heap. For [!INCLUDEssazuresynapse-md], the value of this column is 1.
hobt_id bigint ID of the data heap or B-tree (HoBT) that contains the rows for this partition.
rows bigint Approximate number of rows in this partition.
data_compression int Indicates the state of compression for each partition:

0 = NONE

1 = ROW

2 = PAGE

3 = COLUMNSTORE
data_compression_desc nvarchar(60) Indicates the state of compression for each partition. Possible values are NONE, ROW, and PAGE.
pdw_node_id int Unique identifier of a [!INCLUDEssazuresynapse-md] node.

Permissions

Requires CONTROL SERVER permission.

Examples: [!INCLUDEssazuresynapse-md] and [!INCLUDEssPDW]

Example A: Display rows in each partition within each distribution

Applies to: [!INCLUDEssazuresynapse-md], [!INCLUDEssPDW]

To display the number of rows in each partition within each distribution, use DBCC PDW_SHOWPARTITIONSTATS (SQL Server PDW) .

Example B: Uses system views to view rows in each partition of each distribution of a table

Applies to: [!INCLUDEssazuresynapse-md]

This query returns the number of rows in each partition of each distribution of the table myTable.

SELECT o.name, pnp.index_id, pnp.partition_id, pnp.rows,   
    pnp.data_compression_desc, pnp.pdw_node_id  
FROM sys.pdw_nodes_partitions AS pnp  
JOIN sys.pdw_nodes_tables AS NTables  
    ON pnp.object_id = NTables.object_id  
AND pnp.pdw_node_id = NTables.pdw_node_id  
JOIN sys.pdw_table_mappings AS TMap  
    ON NTables.name = TMap.physical_name 
    AND substring(TMap.physical_name,40, 10) = pnp.distribution_id 
JOIN sys.objects AS o  
    ON TMap.object_id = o.object_id  
WHERE o.name = 'myTable'  
ORDER BY o.name, pnp.index_id, pnp.partition_id;  

See Also

Azure Synapse Analytics and Parallel Data Warehouse Catalog Views