MySQL6の新エンジン「Falcon」でテーブルスペース
mysql5ではndbclusterでしか作成できなかったテーブルスペースがmysql6のFalconでは作成できるようなのでテストしてみた
mysql> use test;
mysql> create tablespace falcon_test_spasce add datafile 'falcon_test_spasce.fl' engine='Falcon';
mysql> create tablespace falcon_test_spasce2 add datafile 'falcon_test_spasce2.fl' engine='Falcon' comment 'Falcon Tablespace test';mysql> select * from information_schema.FALCON_TABLESPACES;
TABLESPACE_NAME | TYPE | COMMENT |
FALCON_USER | FALCON_USER | |
FALCON_TEMPORARY | FALCON_TEMPORARY | |
falcon_test_spasce | USER_DEFINED | |
falcon_test_spasce2 | USER_DEFINED | Falcon Tablespace test |
4 rows in set (0.00 sec)
mysql> select * from information_schema.FALCON_TABLESPACE_IO;
TABLESPACE | PAGE_SIZE | BUFFERS | PHYSICAL_READS | WRITES | LOGICAL_READS | FAKES |
FALCON_MASTER | 4096 | 1024 | 56 | 1 | 1057 | 0 |
falcon_test_spasce2 | 4096 | 1024 | 0 | 4 | 0 | 4 |
falcon_test_spasce | 4096 | 1024 | 0 | 4 | 0 | 4 |
FALCON_TEMPORARY | 4096 | 1024 | 1 | 0 | 0 | 1 |
FALCON_USER | 4096 | 1024 | 1 | 0 | 0 | 1 |
5 rows in set (0.00 sec)
mysql> select * from information_schema.FALCON_TABLESPACE_FILES;
TABLESPACE_NAME | TYPE | FILE_ID | FILE_NAME |
FALCON_USER | FALCON_USER | 1 | falcon_user.fts |
FALCON_TEMPORARY | FALCON_TEMPORARY | 1 | falcon_temporary.fts |
falcon_test_spasce | USER_DEFINED | 1 | falcon_test_spasce.fl |
falcon_test_spasce2 | USER_DEFINED | 1 | falcon_test_spasce2.fl |
4 rows in set (0.00 sec)
ほうほう
でテーブル作成&データインサート
mysql> create table t4 (id integer not null primary key, name varchar(85) not null) tablespace falcon_test_spasce2 engine=falcon;
Query OK, 0 rows affected (0.03 sec)mysql> select * from information_schema.FALCON_TABLESPACE_IO where TABLESPACE='falcon_test_spasce2';
TABLESPACE | PAGE_SIZE | BUFFERS | PHYSICAL_READS | WRITES | LOGICAL_READS | FAKES |
falcon_test_spasce2 | 4096 | 1024 | 3 | 4 | 6 | 7 |
5 rows in set (0.00 sec)
mysql> set @i=0;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into t4 (select @i:=@i+1, 'mochi');
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> insert into t4 (select @i:=@i+1, 'mochi');
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> insert into t4 (select @i:=@i+1, 'mochi');
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> insert into t4 (select @i:=@i+1, 'mochi');
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> insert into t4 (select @i:=@i+1, 'mochi');
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> insert into t4 (select @i:=@i+1, 'mochi');
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> select * from information_schema.FALCON_TABLESPACE_IO where TABLESPACE='falcon_test_spasce2';
TABLESPACE | PAGE_SIZE | BUFFERS | PHYSICAL_READS | WRITES | LOGICAL_READS | FAKES |
falcon_test_spasce2 | 4096 | 1024 | 3 | 4 | 27 | 8 |
1 row in set (0.00 sec)
なるほどね〜
おそらくPAGE_SIZEとかBUFFERSはmy.cnfかset @@global.falcon***みたいなので変更できるのかな?
mysql> show variables like '%Falcon%';
Variable_name | Value |
falcon_checkpoint_schedule | 7 * * * * * |
falcon_consistent_read | ON |
falcon_debug_mask | 0 |
falcon_debug_server | OFF |
falcon_debug_trace | 0 |
falcon_direct_io | 1 |
falcon_gopher_threads | 5 |
falcon_index_chill_threshold | 4 |
falcon_initial_allocation | 0 |
falcon_io_threads | 2 |
falcon_large_blob_threshold | 160000 |
falcon_lock_wait_timeout | 50 |
falcon_max_transaction_backlog | 150 |
falcon_page_cache_size | 4194304 |
falcon_page_size | 4096 |
falcon_record_chill_threshold | 5 |
falcon_record_memory_max | 262144000 |
falcon_record_scavenge_floor | 50 |
falcon_record_scavenge_threshold | 67 |
falcon_scavenge_schedule | 15,45 * * * * * |
falcon_serial_log_block_size | 0 |
falcon_serial_log_buffers | 20 |
falcon_serial_log_dir | |
falcon_serial_log_priority | 1 |
falcon_support_xa | OFF |
falcon_use_deferred_index_hash | OFF |
26 rows in set (0.00 sec)
あれ?PAGE_SIZEしかない???
とりあえずそっちだけ変更
mysql> set @@falcon_page_size='10485760';
ERROR 1238 (HY000): Variable 'falcon_page_size' is a read only variable
mysql> set @@global.falcon_page_size='10485760';
ERROR 1238 (HY000): Variable 'falcon_page_size' is a read only variable
・・・できない
てことはmy.cnfとかで設定しないといけないのかな?
まあ今日はここまでで
マニュアルはまだ本家の英語版のみ
http://dev.mysql.com/doc/refman/6.0/en/se-falcon-createdb.html