MemSQL supports collecting value-level statistics on a table to facilitate accurate query optimization via the
ANALYZE TABLE command. Query explain plans in MemSQL will warn users and suggest
ANALYZE commands to run whenever the engine detects that such statistics may be helpful. However, a user may experience a situation where even after running the commands suggested by the explain plan, they continue to receive these "missing statistics" warnings.
Statistics are tied to a base table and are not changed when the table is modified through DML statements. However, all statistics and range statistics designations on a table may be dropped when the table is modified through DDL statements like
Additionally, there are certain commands such as
CREATE INDEX, and
DROP INDEX that are not explicitly
ALTERs but can cause the table statistics to be dropped.
If any such commands have been run since the last
ANALYZE, table statistics will need to be recollected.