Engine-independent persistent statistics with histograms in MariaDB
The talk is devoted to the module that introduces engine independent
statistical tables into MariaDB and to the new perspectives that it
opens for the optimizer to improve query execution plans for different
engines. The module itself and the additions to the optimizer that allow
to use extended statistical data when looking for optimal query
execution plans are parts of the MariaDB 10.0 branch.
Plan stability is one of the major prerequisites for a robust
development of many database applications. Persistent tables with
non-volatile statistical data that could be modified independently on
the database content will easily allow to reach plan stability.
Many experimental engines can not afford themselves the luxury of
having their own handler functions to provide sound statistical data.
As a result the optimizer behave in a quite unfriendly manner towards
them generating poor execution plans.
More sophisticated algorithms of choosing fast execution plans
require advanced statistical data such as histograms on the distribution
of column values. This data is basically content-dependent and and it
does not make sense to require all storage engines to maintain them.
Advanced engines, such as InnoDB and TokuDB, will greatly benefit from
this extended statistics.