[MDEV-13152] Indeterministic row number in SHOW TABLE STATUS on RocksDB table Created: 2017-06-22  Updated: 2017-07-24  Resolved: 2017-07-24

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - RocksDB
Affects Version/s: 10.2
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

10.2 0992be927e1c686c39c39fe53fc2a7869d55143d



 Description   

DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a INT, b VARCHAR(8)) ENGINE=RocksDB;
INSERT INTO t1 (a,b) VALUES (100,'a'),(2,'foo');
CREATE TABLE t2 (a INT, b VARCHAR(8)) ENGINE=RocksDB;
INSERT INTO t2 (a,b) VALUES (1,'bar');
ANALYZE TABLE t1, t2;
SHOW TABLE STATUS;
DROP TABLE t1, t2;

By repeating the same set of queries, I get different results.

Sometimes the output shows 2 rows for t1, as it should be:

MariaDB [test]> SHOW TABLE STATUS \G
*************************** 1. row ***************************
           Name: t1
         Engine: ROCKSDB
        Version: 10
     Row_format: Dynamic
           Rows: 2
 Avg_row_length: 30
    Data_length: 60
Max_data_length: 0
   Index_length: 0
      Data_free: 0
 Auto_increment: NULL
    Create_time: NULL
    Update_time: NULL
     Check_time: NULL
      Collation: latin1_swedish_ci
       Checksum: NULL
 Create_options: 
        Comment: 
*************************** 2. row ***************************
           Name: t2
         Engine: ROCKSDB
        Version: 10
     Row_format: Dynamic
           Rows: 1
 Avg_row_length: 30
    Data_length: 30
Max_data_length: 0
   Index_length: 0
      Data_free: 0
 Auto_increment: NULL
    Create_time: NULL
    Update_time: NULL
     Check_time: NULL
      Collation: latin1_swedish_ci
       Checksum: NULL
 Create_options: 
        Comment: 
2 rows in set (0.01 sec)

And sometimes it's 3 (and the data length differs):

MariaDB [test]> SHOW TABLE STATUS \G
*************************** 1. row ***************************
           Name: t1
         Engine: ROCKSDB
        Version: 10
     Row_format: Dynamic
           Rows: 3
 Avg_row_length: 30
    Data_length: 90
Max_data_length: 0
   Index_length: 0
      Data_free: 0
 Auto_increment: NULL
    Create_time: NULL
    Update_time: NULL
     Check_time: NULL
      Collation: latin1_swedish_ci
       Checksum: NULL
 Create_options: 
        Comment: 
*************************** 2. row ***************************
           Name: t2
         Engine: ROCKSDB
        Version: 10
     Row_format: Dynamic
           Rows: 1
 Avg_row_length: 30
    Data_length: 30
Max_data_length: 0
   Index_length: 0
      Data_free: 0
 Auto_increment: NULL
    Create_time: NULL
    Update_time: NULL
     Check_time: NULL
      Collation: latin1_swedish_ci
       Checksum: NULL
 Create_options: 
        Comment: 
2 rows in set (0.00 sec)



 Comments   
Comment by Sergei Petrunia [ 2017-07-24 ]

This is not considered a bug.

I've made a write-up about MyRocks statistics at: https://mariadb.com/kb/en/mariadb/optimizer-statistics-in-myrocks/ .

Generated at Thu Feb 08 08:03:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.