← Back to team overview

maria-developers team mailing list archive

Engine independent index statistics - infrastructure questions


Hello Igor and others,

I've been playing around with engine independent statistics, 
and got a few questions.

== mysqldump ==
mysqldump dumps table' data, but besides that it can dump other related
objects, e.g. it will dump triggers that are attached to the table.
Should it dump table statistics values, also? 

This question is of interest for DBAs, but also for optimizer developers. If
a user has a complaint about the optimizer, we frequently ask them to upload a
dataset. How do we request table/column statistics? We can't request output of 
SELECT * ..., because histogram data is binary and will be corrupted.  We
should provide users a convinent way to pass us relevant part of the EITS

== dropping table statistics ==
How does one drop table statistics? are we satisfied with needing to run
three statements

DELETE FROM mysql.column_stats WHERE schema_name=$db AND table_name=$table_name;
DELETE FROM mysql.index_stats  WHERE table_name=$db AND table_name=$table_name;
DELETE FROM mysql.column_stats WHERE table_name=$db AND table_name=$table_name;

or we want a simpler SQL, like


== Permissions on statistic tables ==

What should be the permissions on statistics tables?  I guess we should follow
pattern from other system tables - a user is typically able to read the table
but not write to it (so that he can't mess with other users' SPs/triggers/etc).

However, if the user is not allowed to modify the table directly, we should
provide enough ways to modify the table indirectly. For example, we should
provide a way to drop statistics for one's tables (which brings us back to the
previous item). We might also want to allow to make other modifications to
statistics of tables that one has control of?

Sergei Petrunia, Software Developer
MariaDB | Skype: sergefp | Blog: http://s.petrunia.net/blog

Follow ups