9.11. Starburst MySQL Connector#

The Starburst MySQL Connector is an extended version of the MySQL Connector with configuration and usage identical.

The following improvements are included:

Table Statistics#

MySQL connector supports table and column statistics, as documented in Table Statistics. The table-level statistics are based on MySQL’s INFORMATION_SCHEMA.TABLES table. The column-level statistics are based on MySQL’s index statistics INFORMATION_SCHEMA.STATISTICS table. The connector can return column-level statistics only when the column is the first column in some index.

MySQL Database can automatically update its table and index statistics. In some cases, you may want to force statistics update (e.g. after creating new index or after changing data in the table). You can do that by executing the following statement in MySQL Database.

ANALYZE TABLE table_name;

The table and column statistics can be viewed in Presto using SHOW STATS and are used for Cost based optimizations.

Note

MySQL and Presto may use statistics information in different ways. For this reason, the accuracy of table and column statistics returned by the MySQL connector might be lower than than that of others connectors.

Improving Statistics Accuracy#

You can improve statistics accuracy with histogram statistics (available since MySQL 8.0). To create histogram statistics execute the following statement in MySQL Database.

ANALYZE TABLE table_name UPDATE HISTOGRAM ON column_name1, column_name2, ...;

Refer to MySQL documentation for information about options, limitations and additional considerations.

Table Statistics Configuration Properties#
Property Name Description Default
statistics.enabled Enables table and column statistics. true
statistics.cache-ttl Duration for which table and column statistics are cached. 0s
statistics.cache-missing Cache the fact that table statistics are not available. false