.alter database policy sharding command

Applies to: ✅ Azure Data Explorer

Changes the database sharding policy. The sharding policy is used to manage data sharding for databases and tables by defining if and how extents (data shards) should be sealed.

When a database is created, it contains the default data sharding policy. All tables created in the database inherit this policy unless the policy is explicitly overridden at the table level.

Permissions

You must have at least Database Admin permissions to run this command.

Syntax

.alter database DatabaseName policy sharding PolicyObject

Learn more about syntax conventions.

Parameters

Name Type Required Description
DatabaseName string ✔️ The name of the database for which to alter the sharding policy.
PolicyObject string ✔️ A policy object that defines the sharding policy. For more information, see the sharding policy.

Returns

Returns a JSON representation of the policy.

Example

The following command returns the updated extents sharding policy for the database:

.alter database MyDatabase policy sharding
```
{
    "MaxRowCount" : 750000,
    "MaxExtentSizeInMb" : 1024,
    "MaxOriginalSizeInMb": 2048
}
```