This options is not used when creating the partitions themselves.
Instead its value is stored in Request and is used when executing the
partitioned request.
The desired maximum number of partitions to return.
The default value for this is null, in which case the server will decide how many partitions to return.
The desired data size for each partition generated.
The default value for this is null, in which case the server will decide the data size for each partition generated.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of \u003ccode\u003ePartitionOptions\u003c/code\u003e is \u003ccode\u003e5.0.0-beta05\u003c/code\u003e, while there are multiple prior versions such as \u003ccode\u003e5.0.0-beta04\u003c/code\u003e, \u003ccode\u003e4.6.0\u003c/code\u003e, and others listed, down to \u003ccode\u003e3.5.0\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePartitionOptions\u003c/code\u003e is an immutable class used to configure the creation and reading of partitions, with default settings handled by the server if not specified.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers properties like \u003ccode\u003eDataBoostEnabled\u003c/code\u003e, \u003ccode\u003eMaxPartitions\u003c/code\u003e, and \u003ccode\u003ePartitionSizeBytes\u003c/code\u003e to customize partition behavior, such as enabling independent compute resources or setting limits for the maximum number and size of partitions.\u003c/p\u003e\n"],["\u003cp\u003eMethods like \u003ccode\u003eWithDataBoostEnabled\u003c/code\u003e, \u003ccode\u003eWithMaxPartitions\u003c/code\u003e, and \u003ccode\u003eWithPartitionSizeBytes\u003c/code\u003e allow the creation of new \u003ccode\u003ePartitionOptions\u003c/code\u003e instances with modified settings, while retaining the properties of the original.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDefault\u003c/code\u003e static property returns an instance of the default \u003ccode\u003ePartitionOptions\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Google.Cloud.Spanner.Data - Class PartitionOptions (5.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.1.0 (latest)](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.PartitionOptions)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/5.0.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.6.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.5.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.4.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.3.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.2.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.1.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.0.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.15.1/Google.Cloud.Spanner.Data.PartitionOptions)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.14.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.13.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.12.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.11.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.10.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.9.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.8.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.7.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.6.0/Google.Cloud.Spanner.Data.PartitionOptions)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.5.0/Google.Cloud.Spanner.Data.PartitionOptions) \n\n public sealed class PartitionOptions\n\nReference documentation and code samples for the Google.Cloud.Spanner.Data class PartitionOptions.\n\nOptions used to create and read partitions.\nInstances of this class are immutable so they can be freely reused. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e PartitionOptions \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Spanner.Data](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data)\n\nAssembly\n--------\n\nGoogle.Cloud.Spanner.Data.dll\n\nProperties\n----------\n\n### DataBoostEnabled\n\n public bool DataBoostEnabled { get; }\n\nIf set to true, the partitioned request will be executed using Spanner independent compute resources.\nThe default value for this option is false.\n\n**Remarks** \nThis options is not used when creating the partitions themselves.\nInstead its value is stored in [Request](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.CommandPartition#Google_Cloud_Spanner_Data_CommandPartition_Request) and is used when executing the\npartitioned request.\n\n### Default\n\n public static PartitionOptions Default { get; }\n\nReturns a default instance of [PartitionOptions](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.PartitionOptions).\n\n### MaxPartitions\n\n public long? MaxPartitions { get; }\n\nThe desired maximum number of partitions to return.\nThe default value for this is null, in which case the server will decide how many partitions to return.\n\n**Remarks** \nThis option is used when creating the partitions.\n\n### PartitionSizeBytes\n\n public long? PartitionSizeBytes { get; }\n\nThe desired data size for each partition generated.\nThe default value for this is null, in which case the server will decide the data size for each partition generated.\n\n**Remarks** \nThis option is used when creating the partitions.\n\nMethods\n-------\n\n### WithDataBoostEnabled(bool?)\n\n public PartitionOptions WithDataBoostEnabled(bool? dataBoostEnabled)\n\nReturns a new instance with the same options as this one, but with the specified new value for [DataBoostEnabled](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.PartitionOptions#Google_Cloud_Spanner_Data_PartitionOptions_DataBoostEnabled).\n\n### WithMaxPartitions(long?)\n\n public PartitionOptions WithMaxPartitions(long? maxPartitions)\n\nReturns a new instance with the same options as this one, but with the specified new value for [MaxPartitions](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.PartitionOptions#Google_Cloud_Spanner_Data_PartitionOptions_MaxPartitions).\n\n### WithPartitionSizeBytes(long?)\n\n public PartitionOptions WithPartitionSizeBytes(long? partitionSizeBytes)\n\nReturns a new instance with the same options as this one, but with the specified new value for [PartitionSizeBytes](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.PartitionOptions#Google_Cloud_Spanner_Data_PartitionOptions_PartitionSizeBytes)."]]