tokudb_file_map

NAME

tokudb_file_map: map TokuDB tables to files and common shell commands

TYPE

View

DESCRIPTION

tokudb_file_map provides a per table listing of underlying TokuDB files.

TokuDB generates a file per index in table. For a partitioned table, that's one file per index per partition, and in any case this amounts to multiple files per table.
TokuDB provides with the INFORMATION_SCHEMA.TokuDB_file_map view; however it is not normalized, and only maps an internal TokuDB entity to file name.

common_schema's tokudb_file_map lists the files on a per table basis, answering the common question of "which files represent my table?".
It also adds common shell queries to answer questions such as "what is the total size of files for my table?"

STRUCTURE

mysql> DESC tokudb_file_map;
+--------------+------------+------+-----+---------+-------+
| Field        | Type       | Null | Key | Default | Extra |
+--------------+------------+------+-----+---------+-------+
| table_schema | text       | YES  |     | NULL    |       |
| table_name   | text       | YES  |     | NULL    |       |
| count_files  | bigint(21) | NO   |     | 0       |       |
| files        | mediumtext | YES  |     | NULL    |       |
| bash_ls      | mediumtext | YES  |     | NULL    |       |
| bash_du      | mediumtext | YES  |     | NULL    |       |
+--------------+------------+------+-----+---------+-------+

SYNOPSIS

Columns of this view:

  • table_schema: schema of TokuDB table.
  • table_name: TokuDB table name.
  • count_files: number of files representing this table.
  • files: comma delimited list of files representing this table.
  • bash_ls: shell ls command to show files of this table.
  • bash_du: shell du command to present total size of files representing this table.
Shell commands are to be executed from within the @@datadir path, and require file system privileges; this is outside MySQL's scope.

EXAMPLES

List TokuDB files for a given table:

mysql> select * from tokudb_file_map where table_name='my_table' \G
*************************** 1. row ***************************
table_schema: my_dwh
  table_name: my_table
 count_files: 42
       files: ./_my_dwh_sql_4665_15be_P_trns_pt_2010_key_trns_pub_algo_ix_a71975_3_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2010_key_trns_pub_cluster_id_ix_a71975_4_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2010_key_trns_pub_date_clustering_type_ix_a71975_5_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2010_key_trns_pub_widget_ix_a71975_6_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2010_main_a71975_2_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2010_status_a71975_1_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2011_key_trns_pub_algo_ix_a71976_3_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2011_key_trns_pub_cluster_id_ix_a71976_4_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2011_key_trns_pub_date_clustering_type_ix_a71976_5_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2011_key_trns_pub_widget_ix_a71976_6_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2011_main_a71976_2_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2011_status_a71976_1_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2012_key_trns_pub_algo_ix_a71977_3_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2012_key_trns_pub_cluster_id_ix_a71977_4_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2012_key_trns_pub_date_clustering_type_ix_a71977_5_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2012_key_trns_pub_widget_ix_a71977_6_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2012_main_a71977_2_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2012_status_a71977_1_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2013_key_trns_pub_algo_ix_a71978_3_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2013_key_trns_pub_cluster_id_ix_a71978_4_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2013_key_trns_pub_date_clustering_type_ix_a71978_5_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2013_key_trns_pub_widget_ix_a71978_6_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2013_main_a71978_2_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2013_status_a71978_1_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2014_key_trns_pub_algo_ix_a71979_3_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2014_key_trns_pub_cluster_id_ix_a71979_4_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2014_key_trns_pub_date_clustering_type_ix_a71979_5_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2014_key_trns_pub_widget_ix_a71979_6_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2014_main_a71979_2_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2014_status_a71979_1_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2015_key_trns_pub_algo_ix_a7197a_3_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2015_key_trns_pub_cluster_id_ix_a7197a_4_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2015_key_trns_pub_date_clustering_type_ix_a7197a_5_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2015_key_trns_pub_widget_ix_a7197a_6_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2015_main_a7197a_2_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_2015_status_a7197a_1_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_all_key_trns_pub_algo_ix_a7197b_3_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_all_key_trns_pub_cluster_id_ix_a7197b_4_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_all_key_trns_pub_date_clustering_type_ix_a7197b_5_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_all_key_trns_pub_widget_ix_a7197b_6_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_all_main_a7197b_2_18.tokudb,./_my_dwh_sql_4665_15be_P_trns_pt_all_status_a7197b_1_18.tokudb
     bash_ls: ls -l ./_my_dwh_sql_4665_15be_P_trns_pt_2010_key_trns_pub_algo_ix_a71975_3_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2010_key_trns_pub_cluster_id_ix_a71975_4_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2010_key_trns_pub_date_clustering_type_ix_a71975_5_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2010_key_trns_pub_widget_ix_a71975_6_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2010_main_a71975_2_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2010_status_a71975_1_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2011_key_trns_pub_algo_ix_a71976_3_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2011_key_trns_pub_cluster_id_ix_a71976_4_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2011_key_trns_pub_date_clustering_type_ix_a71976_5_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2011_key_trns_pub_widget_ix_a71976_6_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2011_main_a71976_2_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2011_status_a71976_1_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2012_key_trns_pub_algo_ix_a71977_3_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2012_key_trns_pub_cluster_id_ix_a71977_4_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2012_key_trns_pub_date_clustering_type_ix_a71977_5_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2012_key_trns_pub_widget_ix_a71977_6_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2012_main_a71977_2_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2012_status_a71977_1_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2013_key_trns_pub_algo_ix_a71978_3_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2013_key_trns_pub_cluster_id_ix_a71978_4_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2013_key_trns_pub_date_clustering_type_ix_a71978_5_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2013_key_trns_pub_widget_ix_a71978_6_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2013_main_a71978_2_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2013_status_a71978_1_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2014_key_trns_pub_algo_ix_a71979_3_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2014_key_trns_pub_cluster_id_ix_a71979_4_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2014_key_trns_pub_date_clustering_type_ix_a71979_5_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2014_key_trns_pub_widget_ix_a71979_6_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2014_main_a71979_2_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2014_status_a71979_1_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2015_key_trns_pub_algo_ix_a7197a_3_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2015_key_trns_pub_cluster_id_ix_a7197a_4_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2015_key_trns_pub_date_clustering_type_ix_a7197a_5_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2015_key_trns_pub_widget_ix_a7197a_6_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2015_main_a7197a_2_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2015_status_a7197a_1_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_all_key_trns_pub_algo_ix_a7197b_3_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_all_key_trns_pub_cluster_id_ix_a7197b_4_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_all_key_trns_pub_date_clustering_type_ix_a7197b_5_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_all_key_trns_pub_widget_ix_a7197b_6_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_all_main_a7197b_2_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_all_status_a7197b_1_18.tokudb
     bash_du: du -ch ./_my_dwh_sql_4665_15be_P_trns_pt_2010_key_trns_pub_algo_ix_a71975_3_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2010_key_trns_pub_cluster_id_ix_a71975_4_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2010_key_trns_pub_date_clustering_type_ix_a71975_5_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2010_key_trns_pub_widget_ix_a71975_6_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2010_main_a71975_2_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2010_status_a71975_1_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2011_key_trns_pub_algo_ix_a71976_3_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2011_key_trns_pub_cluster_id_ix_a71976_4_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2011_key_trns_pub_date_clustering_type_ix_a71976_5_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2011_key_trns_pub_widget_ix_a71976_6_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2011_main_a71976_2_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2011_status_a71976_1_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2012_key_trns_pub_algo_ix_a71977_3_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2012_key_trns_pub_cluster_id_ix_a71977_4_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2012_key_trns_pub_date_clustering_type_ix_a71977_5_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2012_key_trns_pub_widget_ix_a71977_6_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2012_main_a71977_2_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2012_status_a71977_1_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2013_key_trns_pub_algo_ix_a71978_3_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2013_key_trns_pub_cluster_id_ix_a71978_4_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2013_key_trns_pub_date_clustering_type_ix_a71978_5_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2013_key_trns_pub_widget_ix_a71978_6_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2013_main_a71978_2_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2013_status_a71978_1_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2014_key_trns_pub_algo_ix_a71979_3_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2014_key_trns_pub_cluster_id_ix_a71979_4_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2014_key_trns_pub_date_clustering_type_ix_a71979_5_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2014_key_trns_pub_widget_ix_a71979_6_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2014_main_a71979_2_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2014_status_a71979_1_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2015_key_trns_pub_algo_ix_a7197a_3_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2015_key_trns_pub_cluster_id_ix_a7197a_4_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2015_key_trns_pub_date_clustering_type_ix_a7197a_5_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2015_key_trns_pub_widget_ix_a7197a_6_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2015_main_a7197a_2_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_2015_status_a7197a_1_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_all_key_trns_pub_algo_ix_a7197b_3_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_all_key_trns_pub_cluster_id_ix_a7197b_4_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_all_key_trns_pub_date_clustering_type_ix_a7197b_5_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_all_key_trns_pub_widget_ix_a7197b_6_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_all_main_a7197b_2_18.tokudb ./_my_dwh_sql_4665_15be_P_trns_pt_all_status_a7197b_1_18.tokudb | tail -n 1

ENVIRONMENT

TokuDB enabled server (>= 5.5)

SEE ALSO

sql_alter_table_tokudb, sql_range_partitions

AUTHOR

Shlomi Noach
 
common_schema documentation