Starburst SingleStore (MemSQL) connector#
The Starburst SingleStore (formerly known as MemSQL) connector is an extended version of the SingleStore connector. It can be used to connect and query SingleStore databases. Configuration and usage is identical.
The following improvements are included:
The additional features of the connector require a valid Starburst Enterprise license, unless otherwise noted.
The connector name is currently still
memsql. No changes are required at
this time to any existing catalogs. New catalogs must also use the
The connector includes a number of performance improvements, detailed in the following sections.
This feature is available for free, and does not require a valid license.
The SingleStore connector supports table and column statistics to improve query processing performance based on the actual data in the data source.
The statistics are collected by SingleStore and retrieved by the connector.
Table-level statistics are based on SingleStore’s
SingleStore can automatically update its table and column statistics. In some cases, you may want to force a statistics update, for example after creating new columns or after changing data in the table. You can do that by executing the following statement in the SingleStore database:
ANALYZE TABLE table_name;
SingleStore statistics are estimates, and SEP and SingleStore may use statistics information in different ways. For this reason, the accuracy of table and column statistics returned by the SingleStore connector might be lower than that of others connectors.
Improving statistics accuracy
You can improve statistics accuracy and access column-level statistics with
histogram statistics. Column-level statistics are based on SingleStore’s column
INFORMATION_SCHEMA.ADVANCED_HISTOGRAMS table, if available. If
that table is not available, the information is based on the
INFORMATION_SCHEMA.OPTIMIZER_STATISTICS table instead.
ADVANCED_HISTOGRAMS table includes additional stats such as the
MAX values for a column, which are not available in the
LEGACY_HISTOGRAMS table. SingleStore’s
requires version 6.5 or later, and a
cardinality_estimation_level >= 6.5.
To check for these conditions and determine whether
available to you, execute the following statement in SingleStore:
SELECT COLUMN_NAME, IF(RANGE_STATS=1, true, false) as histograms_available, IF(ADVANCED_HISTOGRAMS=1, 'Advanced', 'Legacy') as histogram_type FROM INFORMATION_SCHEMA.OPTIMIZER_STATISTICS WHERE DATABASE_NAME = 'db' AND TABLE_NAME = 'table';
If they are available in your SingleStore version, use the following statement
to populate the
ANALYZE TABLE table_name COLUMNS ALL ENABLE;
Refer to the SingleStore documentation for information about options, limitations and additional considerations.
The connector supports pushdown for the following aggregate functions:
Dynamic filtering is enabled by default. It causes the connector to wait for dynamic filtering to complete before starting a JDBC query.
You can disable dynamic filtering by setting the property
dynamic-filtering.enabled in your catalog properties file to
Caching table projections#
The connectors supports table scan redirection to improve performance and reduce load on the data source.