Table of Contents

Class ObjectSchema.Partition

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

sys.partitions (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

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 are not 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
Extension Methods

Properties

DataCompression

Indicates the state of compression for each partition:

0 = NONE
1 = ROW
2 = PAGE
3 = COLUMNSTORE : Applies to: SQL Server 2012 (11.x) and later
4 = COLUMNSTORE_ARCHIVE : Applies to: SQL Server 2014 (12.x) and later

Note: Full text indexes will be compressed in any edition of SQL Server.

[Column("data_compression")]
[NotNull]
public byte DataCompression { get; set; }

Property Value

byte

DataCompressionDesc

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

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

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

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

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

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

Indicates the partition ID. Is unique within a database.

[Column("partition_id")]
[NotNull]
public long PartitionID { get; set; }

Property Value

long

PartitionNumber

Is 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

Indicates the approximate number of rows in this partition.

[Column("rows")]
[Nullable]
public long? Rows { get; set; }

Property Value

long?