There is a further problem, using RocksDB. Take this query on a very large table. Please note that all fields are boolean, i.e. numeric, and the three fields are indexed.
explain select count(*) from asterisk.npadata where reachable=1 and port_type=2 and tested=0;
|
+------+-------------+---------+-------------+------------------------------------------+------------------------------------------+---------+------+------------+------------------------------------------------------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+---------+-------------+------------------------------------------+------------------------------------------+---------+------+------------+------------------------------------------------------------------------+
|
| 1 | SIMPLE | npadata | index_merge | IDX_npadata_tested,IDX_npadata_reachable | IDX_npadata_tested,IDX_npadata_reachable | 2,2 | NULL | 1139455527 | Using intersect(IDX_npadata_tested,IDX_npadata_reachable); Using where |
|
+------+-------------+---------+-------------+------------------------------------------+------------------------------------------+---------+------+------------+------------------------------------------------------------------------+
|
I had to stop the query after 12 hours. It is basically useless for BIG data. This query in MsSQL may take 15 minutes max. I could try InnoDB but it will require several times the disk space as RocksDB. Should I try TokuDB, or this is an issue with the optimizer?
I want to emphasize that anybody can do a faster job on the same query using a CSV file and plain old AWK. It is trivial.
The entire data fits in memory:
+---------+---------+----------+----------+------------+
|
| ENGINE | Data MB | Index MB | Total MB | Num Tables |
|
+---------+---------+----------+----------+------------+
|
| NULL | NULL | NULL | NULL | 4 |
|
| Aria | 0.0 | 0.0 | 0.0 | 1 |
|
| CSV | 0.0 | 0.0 | 0.0 | 3 |
|
| InnoDB | 62981.1 | 609.4 | 63590.5 | 37 |
|
| MyISAM | 0.8 | 0.1 | 0.9 | 25 |
|
| ROCKSDB | 14842.9 | 42893.4 | 57736.3 | 2 |
|
+---------+---------+----------+----------+------------+
|
6 rows in set (0.017 sec)
|
|
MariaDB [asterisk]> show variables like 'rocksdb%cache';
|
+-------------------------------------------------+-------+
|
| Variable_name | Value |
|
+-------------------------------------------------+-------+
|
| rocksdb_no_block_cache | OFF |
|
| rocksdb_pin_l0_filter_and_index_blocks_in_cache | ON |
|
| rocksdb_skip_fill_cache | OFF |
|
| rocksdb_use_clock_cache | OFF |
|
+-------------------------------------------------+-------+
|
4 rows in set (0.002 sec)
|
|
MariaDB [asterisk]> show variables like 'rocksdb%cache%';
|
+-------------------------------------------------+-------------+
|
| Variable_name | Value |
|
+-------------------------------------------------+-------------+
|
| rocksdb_block_cache_size | 96636764160 |
|
| rocksdb_cache_index_and_filter_blocks | ON |
|
| rocksdb_force_compute_memtable_stats_cachetime | 60000000 |
|
| rocksdb_no_block_cache | OFF |
|
| rocksdb_persistent_cache_path | |
|
| rocksdb_persistent_cache_size_mb | 0 |
|
| rocksdb_pin_l0_filter_and_index_blocks_in_cache | ON |
|
| rocksdb_sim_cache_size | 0 |
|
| rocksdb_skip_fill_cache | OFF |
|
| rocksdb_table_cache_numshardbits | 19 |
|
| rocksdb_use_clock_cache | OFF |
|
+-------------------------------------------------+-------------+
|
I think it's the same implicit charset conversion issues already discussed in another bug report
MDEV-14698. I'll leave it to alice to make sure of that.