Skip to main content

Blockchain Stats

Overview​

Blockchain stats are used to represent the distribution of values in a blockchain and consequently increase the accuracy of the query optimizer when searching for optimal query plans. bSQL statistics have a few key features:

  • Reliable Accuracy

    All blockchain mutations atomically update the blockchain stats to represent the updated distribution. bSQL stats never lose a significant amount of accuracy.

  • Buildable

    bSQL uses an array of data collection and modeling techniques to build more accurate blockchain statistics. bSQL users can access this feature by running the BUILD STATS command.

  • Serializable

    bSQL statistics always persist after a database failure and rebuild cycle and don't need to be manually rebuilt.

  • Optional

    bSQL statistics are blockchain-specific and optional. If a blockchain is rarely used for complex queries, dropping stats can help increase mutation speed.

Auto Build​

Currently, the bSQL system has an auto-build feature; stats are built automatically when a basic logarithmic threshold is met. When AUTO BUILD is turned on statistics are built automatically. When turned off, the user must build stats manually in order to achieve optimal query speeds.

See Also​