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:
All blockchain mutations atomically update the blockchain stats to represent the updated distribution. bSQL stats never lose a significant amount of accuracy.
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.
bSQL statistics always persist after a database failure and rebuild cycle and don't need to be manually rebuilt.
bSQL statistics are blockchain-specific and optional. If a blockchain is rarely used for complex queries, dropping stats can help increase mutation speed.
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.