information_schema.index_statistics isn't populated for tokudb tables

Bug #1629448 reported by fimbulvetr on 2016-09-30
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.6
Fix Released
Wishlist
George Ormond Lorch III
5.7
Fix Released
Wishlist
George Ormond Lorch III

Bug Description

No index stats are written for tables that use the tokudb engine.

While the test case is simple, this holds true for complex tables with billions of rows of data.
[test]> create table test_innodb (id tinyint(3) not null primary key) engine=innodb;
Query OK, 0 rows affected (0.03 sec)

[test]> create table test_tokudb (id tinyint(3) not null primary key) engine=tokudb;
Query OK, 0 rows affected (0.04 sec)

[test]> insert into test_innodb values (1);
Query OK, 1 row affected (0.01 sec)

[test]> insert into test_innodb values (2);
Query OK, 1 row affected (0.00 sec)

[test]> insert into test_tokudb values (1);
Query OK, 1 row affected (0.01 sec)

[test]> insert into test_tokudb values (2);
Query OK, 1 row affected (0.01 sec)

[test]> flush index_statistics;
Query OK, 0 rows affected (0.01 sec)

[test]> select * from test_innodb where id = 1;
+----+
| id |
+----+
| 1 |
+----+
1 row in set (0.00 sec)

[test]> select * from test_tokudb where id = 1;
+----+
| id |
+----+
| 1 |
+----+
1 row in set (0.00 sec)

[test]> select * from information_schema.index_statistics;
+--------------+----------------------------+------------+-----------+
| TABLE_SCHEMA | TABLE_NAME | INDEX_NAME | ROWS_READ |
+--------------+----------------------------+------------+-----------+
| test | test_innodb | PRIMARY | 1 |
+--------------+----------------------------+------------+-----------+
3 rows in set (0.00 sec)

[test]> select version();
+--------------+
| version() |
+--------------+
| 5.7.14-8-log |
+--------------+
1 row in set (0.00 sec)

[test]> show global variables like 'userstat';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| userstat | ON |
+---------------+-------+
1 row in set (0.00 sec)

fimbulvetr (fimbulvetr) on 2016-09-30
tags: added: tokudb
George Ormond Lorch III (gl-az) wrote :

This is correct, tokudb does not nor has ever provided any of the Percona Server added user statistics described here https://www.percona.com/doc/percona-server/5.5/diagnostics/user_stats.html

It is on the long term roadmap with no scheduled implementation time.

Changed in percona-server:
importance: Undecided → Wishlist
tags: added: userstat
fimbulvetr (fimbulvetr) wrote :

This feature does work on the binaries/patches Tokutek distributed prior to the Percona acquisition (i.e. 5.5.41-tokudb-7.5.5-MariaDB-log).

While this won't materially affect our upgrade to PS from Tokutek binaries, it is quite disappointing that this is merely on the "long term" road map, given that you had/have the very code/knowledge that allowed to to work before - that said, I do understand that it's not always as easy as just porting the code from the old branches.

George Ormond Lorch III (gl-az) wrote :

It is an interesting historical looping.
MariaDB ported userstats (client, index, table, thread, user) from Percona Server (I believe, it is not an upstream MySQL feature).
Tokutek implemented TokuDB userstats within their builds/distro of MariaDB.
For some reason here at Percona, before the acquisition of Tokutek and during our initial importing of TokuDB into Percona Server, we never integrated TokuDB into userstats ourselves.

I agree, knowing that the code is out there and not having it seems a shame to not have it now in the native builds of Percona Server and TokuDB.

I say it is on long term roadmap because it no one so far has requested it and there are other things ahead of it and in the works such as Performance Schema, XtraBackup integration, checkpoint performance, and concurrency improvements. Since you are interested in its use and we know there is code for it 'out there' already, I will try to give it a place in the nearer future as time and resources allow.

George Ormond Lorch III (gl-az) wrote :

My curiosity got the best of me. I did a little looking and it seems this is specific to 5.7 where the some of userstat index stats functionality has been pushed from the common handler code into the handler (engine) specific code. During our merge of TokuDB from 5.6 to 5.7, we(I) missed this. This _looks_ like it is only a few lines of code to fix and adding to the mtr test case so we do not lose this again. I think it is safe to say that you can expect to see this fixed in a soon to come version of Percona server 5.7. Stay subscribed to this issue to get notification of the target version when it is fixed and tested.

fimbulvetr (fimbulvetr) wrote :

Thank you George and Percona. Very much appreciated.

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-2485

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers