Skip to main content

DROP STATS

Drops statistics on a blockchain. For examples, see Examples.

bSQL Syntax Conventions

Syntax​

DROP STATS|STATISTICS ON 
{ blockchain_name | database_name.blockchain_name }

Arguments​

database_name
Is the name of the database in which the target blockchain persists.

blockchain_name
The name of the blockchain whose stats will be dropped.

Permissions​

MANAGEMENT permission required on the target blockchain.

MANAGEMENT permissions default to members of the admin and developer fixed database roles. Members of the admin role can transfer permissions to other users.

Best Practices​

Dropping statistics from a blockchain can increase mutation speed and reduce storage, but consequently may cause the optimizer to return non-optimal query plans, i.e, drop statistics from infrequently accessed blockchains with heavy transaction loads. Please refer to stats overview for a more detailed explanation on how statistics are built for performance.

Limitations​

  • Dropping stats from a blockchain without stats will error.
  • Currently, once statistics are dropped from a blockchain they can't be rebuilt.

Example​

The following example will drop stats from the pricing blockchain in the demo database, reducing mutation speed and storage costs for the pricing blockchain.

DROP STATS ON financial.pricing

See Also​