Table of Contents

Class ObjectSchema.Partition

Namespace
LinqToDB.Tools.DataProvider.SqlServer.Schemas
Assembly
linq2db.Tools.dll

sys.partitions (Transact-SQL)

Applies to:SQL ServerAzure SQL DatabaseAzure SQL Managed InstanceAzure Synapse AnalyticsAnalytics Platform System (PDW)SQL analytics endpoint in Microsoft FabricWarehouse in Microsoft Fabric

Contains a row for each partition of all the tables and most types of indexes in the database. Special index types such as Full-Text, Spatial, and XML aren't included in this view. All tables and indexes in SQL Server contain at least one partition, whether or not they are explicitly partitioned.


See sys.partitions.

[Table(Schema = "sys", Name = "partitions", IsView = true)]
public class ObjectSchema.Partition
Inheritance
ObjectSchema.Partition
Inherited Members
Extension Methods

Properties

DataCompression

data_compression NOT NULL tinyint

Indicates the state of compression for each partition:

0 = NONE
1 = ROW
2 = PAGE
3 = COLUMNSTORE 1
4 = COLUMNSTORE_ARCHIVE 2

Note: Full text indexes are compressed in any edition of SQL Server.
[Column("data_compression")]
[NotNull]
public byte DataCompression { get; set; }

Property Value

byte

DataCompressionDesc

data_compression_desc NULL nvarchar(60)

Indicates the state of compression for each partition. Possible values for rowstore tables are NONE, ROW, and PAGE. Possible values for columnstore tables are COLUMNSTORE and COLUMNSTORE_ARCHIVE.
[Column("data_compression_desc")]
[Nullable]
public string? DataCompressionDesc { get; set; }

Property Value

string

FilestreamFileGroupID

filestream_filegroup_id NOT NULL smallint

Applies to: SQL Server 2012 (11.x) and later versions.

Indicates the ID of the FILESTREAM filegroup stored on this partition.
[Column("filestream_filegroup_id")]
[NotNull]
public short FilestreamFileGroupID { get; set; }

Property Value

short

HoBTID

hobt_id NOT NULL bigint

Indicates the ID of the data heap or B-tree (HoBT) that contains the rows for this partition.
[Column("hobt_id")]
[NotNull]
public long HoBTID { get; set; }

Property Value

long

IndexID

index_id NOT NULL int

Indicates the ID of the index within the object to which this partition belongs.

0 = heap
1 = clustered index
2 or greater = nonclustered index
[Column("index_id")]
[NotNull]
public int IndexID { get; set; }

Property Value

int

Object

objects (sys.objects)

[Association(ThisKey = "ObjectID", OtherKey = "ObjectID", CanBeNull = false)]
public ObjectSchema.Object Object { get; set; }

Property Value

ObjectSchema.Object

ObjectID

object_id NOT NULL int

Indicates the ID of the object to which this partition belongs. Every table or view is composed of at least one partition.
[Column("object_id")]
[NotNull]
public int ObjectID { get; set; }

Property Value

int

PartitionID

partition_id NOT NULL bigint

Indicates the partition ID. Unique within a database.
[Column("partition_id")]
[NotNull]
public long PartitionID { get; set; }

Property Value

long

PartitionNumber

partition_number NOT NULL int

A 1-based partition number within the owning index or heap. For non-partitioned tables and indexes, the value of this column is 1.
[Column("partition_number")]
[NotNull]
public int PartitionNumber { get; set; }

Property Value

int

Rows

rows NULL bigint

Indicates the approximate number of rows in this partition.
[Column("rows")]
[Nullable]
public long? Rows { get; set; }

Property Value

long?

XmlCompression

xml_compression NULL bit

Applies to: SQL Server 2022 (16.x) and later versions.

Indicates the state of XML compression for each partition:

0 = OFF
1 = ON
[Column("xml_compression")]
[Nullable]
public bool? XmlCompression { get; set; }

Property Value

bool?

XmlCompressionDesc

xml_compression_desc NULL varchar(3)

Applies to: SQL Server 2022 (16.x) and later versions.

Indicates the state of XML compression for each partition. Possible values are OFF and ON.
[Column("xml_compression_desc")]
[Nullable]
public string? XmlCompressionDesc { get; set; }

Property Value

string