SlideShare a Scribd company logo
1 of 104
Download to read offline
MySQL 5.7で遊んでみよう
2015/10/24
yoku0825
OSC 2015 Tokyo/Fall
MySQL 5.7.9 GA
has been
released at
2015/10/19!!
1/103
なんです
が
2/103
MySQL 5.7を
本番で使う話
はしま せん
3/103
まずは新しい機能
で 遊んでみましょ
う という話をしま
す
4/103
\こんにちは/
yoku0825@とある企業のDBA
オラクれない-
ポスグれない-
マイエスキューエる-
家に帰ると
妻の夫-
せがれの⽗-
ムスメの⽗-
Twitter: @yoku0825
Blog: ⽇々の覚書
MyNA ML: ⽇本MySQLユーザ会
5/103
遊ぶ準備
ホストがあると便利
VirtualBox-
どこかでVPS借りてもいいけどTerminateを忘れずに
InnoDBバッファプールサイズの変更を試すには、メモ
リー⼤盛りのが楽しいかも
-
6/103
インストール
CentOS 6.5です。。
ちょっと遊ぶくらいならyumリポジトリーでいい
新しいyumリポジトリーは既にデフォルトでインストールす
るのがMySQL 5.7になってる
# rpm -i http://dev.mysql.com/get/mysql57-community-release-el6-
7.noarch.rpm
# yum install mysql-community-server
MySQL :: Download MySQL Yum Repository
7/103
起動
service mysqld startのタイミングでmysqld --initialize
(mysql_install_dbの後継)が⾛る
# service mysqld start
Initializing MySQL database: 2015-10-19T04:47:16.696030Z 0 [Warn
ing] TIMESTAMP with implicit DEFAULT value is deprecated. Please
use --explicit_defaults_for_timestamp server option (see document
ation for more details).
8/103
接続…︖
# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (us
ing password: NO)
# ls -l ~/.mysql_secret
ls: cannot access /root/.mysql_secret: No such file or directory
9/103
初期パスワード
初期パスワードは設定されている
mysql_install_dbは~/.mysql_secretを作ったけど、mysqld
--initializeは 標準エラー出⼒ にパスワードを出⼒する
log_errorが設定されていればそのファイルに、設定され
ていなければコンソールに。
-
10/103
パスワードの在り処
# grep log-error /etc/my.cnf
log-error=/var/log/mysqld.log
# grep password /var/log/mysqld.log
2015-10-19T04:47:17.752156Z 1 [Warning] A temporary password is g
enerated for root@localhost: jM*C.2dAc6dh
2015-10-19T04:47:22.244470Z 2 [Note] Access denied for user 'UNKN
OWN_MYSQL_USER'@'localhost' (using password: NO)
2015-10-19T04:47:36.374844Z 3 [Note] Access denied for user 'root
'@'localhost' (using password: NO)
11/103
ログインはできたけれど
# mysql -p
Enter password:
mysql> status
ERROR 1820 (HY000): You must reset your password using ALTER USE
R statement before executing this statement.
12/103
パスワードを変更しようとするけど。。
mysql> SET PASSWORD = '';
ERROR 1819 (HY000): Your password does not satisfy the current po
licy requirements
13/103
MySQL 5.7のrpmではvalidate̲passwordがデフォル
トでインストールされている
というよりは、今までが「デフォルトで⼊っているつもりが
⼊っていなかった」ので、そのバグをFIX、ということらし
い。
The validate̲password plugin was not installed by
RPM packages for platorms using systemd or SysV-
style initialization scripts. (Bug #18438833)
MySQL :: MySQL 5.7 Release Notes :: Changes in MySQL
5.7.8 (2015-08-03, Release Candidate)
14/103
validate_password= OFFを/etc/my.cnfに書くやり⽅
# vim /etc/my.cnf
[mysqld]
validate_password= OFF
# service mysqld restart
# mysql -p
Enter password:
mysql> SET PASSWORD= '';
Query OK, 0 rows affected (0.00 sec)
15/103
⼀度強⼒なパスワードで変更してから無効にするやり⽅
mysql> SET PASSWORD= 'Do_you_love_MySQL57?';
Query OK, 0 rows affected (0.00 sec)
mysql> UNINSTALL PLUGIN validate_password;
Query OK, 0 rows affected (0.01 sec)
mysql> SET PASSWORD= '';
Query OK, 0 rows affected (0.00 sec)
16/103
ちなみに有効な場合のデフォルトのパスワードポリシー
UNINSTALL PLUGINした場合は何も出てこない。
mysql> SHOW GLOBAL VARIABLES LIKE 'validate_password%';
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password_dictionary_file | |
| validate_password_length | 8 |
| validate_password_mixed_case_count | 1 |
| validate_password_number_count | 1 |
| validate_password_policy | MEDIUM |
| validate_password_special_char_count | 1 |
+--------------------------------------+--------+
6 rows in set (0.00 sec)
17/103
sysスキーマ
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| mysqlslap |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
18/103
sysスキーマ
mysql> use sys
Database changed
mysql> SHOW TABLES;
..
mysql> SELECT * FROM statement_analysis;
..
19/103
sysスキーマ
performance̲schemaとinformation̲schemaのテーブル
をベースにしたビュー
performance̲schemaが無効になってるとほぼ空っぽ。-
5.7ではオーバーヘッドかなり⼩さくなってるし、有効に
しておいていいと思う。
-
CPUバウンドな場合はまだオーバーヘッド気になるか
も。I/Oバウンドするなら誤差範囲。
-
x$で始まる名前のビューは単位変換(G, M, K, m, u, n)なし
デフォルトの時間単位はps-
20/103
はい次
21/103
MySQL 5.7の全⽂検索
「全ツイート履歴をダウンロード」してきた。
mysql> CREATE TABLE tweet ( tweet_id BIGINT UNSIGNED PRIMARY KE
Y, timestamp DATETIME NOT NULL, text TEXT);
mysql> LOAD DATA INFILE '/tmp/tweets.csv' INTO TABLE tweet FIELD
S TERMINATED BY ',' ENCLOSED BY '"' IGNORE 1 LINES (tweet_id, @d
ummy, @dummy, @timestamp, @dummy, text, @dummy) SET timestamp= DA
TE_ADD(@timestamp, INTERVAL 9 HOUR);
ERROR 1290 (HY000): The MySQL server is running with the --secure
-file-priv option so it cannot execute this statement
22/103
secure_file_privの暗黙のデフォルト値
rpm, dpkgのみ暗黙のデフォルト値がある。。
mysql> SELECT @@secure_file_priv;
+-----------------------+
| @@secure_file_priv |
+-----------------------+
| /var/lib/mysql-files/ |
+-----------------------+
1 row in set (0.00 sec)
23/103
sql_modeが強化
ツイート履歴はʼyyyy/mm/dd hh:nn:ss +TZʼな形式のタイ
ムスタンプを持っているので、MySQLがそのままは⾷えな
い。
ʻ+TZʼの部分を無理⽮理読み⾶ばして9時間⾜してやること
で5.6では何とかなったが
mysql> LOAD DATA INFILE '/var/lib/mysql-files/tweets.csv' INTO TABLE twe
et FIELDS TERMINATED BY ',' ENCLOSED BY '"' IGNORE 1 LINES (tweet_id, @
dummy, @dummy, @timestamp, @dummy, text, @dummy) SET timestamp= DATE_ADD
(@timestamp, INTERVAL 9 HOUR);
ERROR 1292 (22007): Truncated incorrect datetime value: '2015-10-19 05:4
6:24 +0000'
mysql> SELECT @@sql_modeG
*************************** 1. row ***************************
@@sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZE
RO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTIT
UTION
1 row in set (0.00 sec)
24/103
申し訳ないが取り敢えず非strictにしよう
ホントはなんかスクリプト書けばそれで済むんだけど⾯
倒。。
mysql> SET sql_mode= '';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> LOAD DATA INFILE '/var/lib/mysql-files/tweets.csv' INTO TA
BLE tweet FIELDS TERMINATED BY ',' ENCLOSED BY '"' IGNORE 1 LINE
S (tweet_id, @dummy, @dummy, @timestamp, @dummy, text, @dummy) SE
T timestamp= DATE_ADD(@timestamp, INTERVAL 9 HOUR);
Query OK, 28051 rows affected, 56102 warnings (0.52 sec)
Records: 28051 Deleted: 0 Skipped: 0 Warnings: 56102
mysql> SET sql_mode= default;
Query OK, 0 rows affected (0.00 sec)
25/103
ngramパーサーは最初から有効になってる
mysql> ALTER TABLE tweet ADD FULLTEXT KEY idx_ngram(text) WITH PA
RSER ngram;
Query OK, 0 rows affected, 1 warning (4.22 sec)
Records: 0 Duplicates: 0 Warnings: 1
26/103
LIKEより遅くて草。。
mysql> SELECT COUNT(*) FROM tweet WHERE text LIKE '%mysql%';
+----------+
| COUNT(*) |
+----------+
| 6265 |
+----------+
1 row in set (0.05 sec)
mysql> SELECT COUNT(*) FROM tweet WHERE match(text) against ('mys
ql' IN BOOLEAN MODE);
+----------+
| COUNT(*) |
+----------+
| 6265 |
+----------+
1 row in set (0.18 sec)
27/103
転置索引の中⾝をのぞいてみる
mysql> SET GLOBAL innodb_ft_aux_table= 'd1/tweet';
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT word, count(*) AS c FROM information_schema.INNODB_FT_INDE
X_TABLE GROUP BY word ORDER BY c DESC LIMIT 10;
+--------+------+
| word | c |
+--------+------+
| my | 9409 |
| sq | 9353 |
| ql | 9346 |
| ys | 8866 |
| co | 8024 |
| って | 7957 |
| er | 6614 |
| 。。 | 5997 |
| tt | 5874 |
| ht | 5715 |
+--------+------+
10 rows in set (8.84 sec)
28/103
トークンのサイズを変更する
オンラインでは無理だった。。
mysql> SELECT @@ngram_token_size;
+--------------------+
| @@ngram_token_size |
+--------------------+
| 2 |
+--------------------+
1 row in set (0.00 sec)
mysql> SET GLOBAL ngram_token_size= 3;
ERROR 1238 (HY000): Variable 'ngram_token_size' is a read only va
riable
29/103
ngram_token_sizeの指定
# vim /etc/my.cnf
[mysqld]
ngram_token_size= 3
# service mysqld restart
30/103
innodb_ft_aux_tableは毎回指定しないといけない
mysql> SET GLOBAL innodb_ft_aux_table= 'd1/tweet';
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT word, count(*) AS c FROM information_schema.INNODB_FT_INDE
X_TABLE GROUP BY word ORDER BY c DESC LIMIT 10;
+--------+------+
| word | c |
+--------+------+
| my | 9409 |
| sq | 9353 |
| ql | 9346 |
| ys | 8866 |
| co | 8024 |
| って | 7957 |
| er | 6614 |
| 。。 | 5997 |
| tt | 5874 |
| ht | 5715 |
+--------+------+
10 rows in set (8.61 sec)
31/103
OPTIMIZE TABLEで転置索引の再構築
mysql> OPTIMIZE TABLE d1.tweet;
-----------------------------+
|
-----------------------------+
g recreate + analyze instead |
|
-----------------------------+
2 rows in set (10.70 sec)
DEX_TABLE GROUP BY word ORDER BY c DES
C LIMIT 10;
+------+------+
| word | c |
+------+------+
| sql | 9094 |
| ysq | 8328 |
| mys | 8311 |
| htt | 5389 |
| ttp | 5388 |
| :// | 5286 |
| //t | 5222 |
| .co | 5201 |
| /t. | 5182 |
| t.c | 5172 |
+------+------+
10 rows in set (13.08 sec)
32/103
MeCabプラグインはバンドルされているけど有効化され
ていない
mysql> ALTER TABLE tweet ADD FULLTEXT KEY idx_mecab(text) WITH PA
RSER mecab;
ERROR 1128 (HY000): Function 'mecab' is not defined
mysql> SHOW PLUGINS;
..
33/103
MeCabプラグインの有効化
# vim /etc/my.cnf
[mysqld]
loose-mecab-rc-file= /usr/lib64/mysql/mecab/etc/mecabrc
# vim /usr/lib64/mysql/mecab/etc/mecabrc
dicdir = /usr/lib64/mysql/mecab/dic/ipadic_utf-8
# service mysqld restart
34/103
MeCabを使った転置索引
mysql> INSTALL PLUGIN mecab SONAME 'libpluginmecab.so';
Query OK, 0 rows affected (0.02 sec)
mysql> ALTER TABLE tweet ADD FULLTEXT KEY idx_mecab(text) WITH PA
RSER mecab;
Query OK, 0 rows affected (1.59 sec)
Records: 0 Duplicates: 0 Warnings: 0
35/103
取り敢えずCOUNT
mysql> SELECT COUNT(*) FROM tweet WHERE text LIKE '%mysql%';
+----------+
| COUNT(*) |
+----------+
| 6265 |
+----------+
1 row in set (0.04 sec)
mysql> SELECT COUNT(*) FROM tweet FORCE INDEX(idx_mecab) WHERE ma
tch(text) against ('mysql' IN BOOLEAN MODE);
+----------+
| COUNT(*) |
+----------+
| 5585 |
+----------+
1 row in set (0.00 sec)
36/103
転置索引
mysql> SET GLOBAL innodb_ft_aux_table= 'd1/tweet';
Query OK, 0 rows affected (0.00 sec)
mysql> ALTER TABLE tweet DROP KEY idx_ngram; -- このままだとngramとMeCabの転置
索引が混じるのでドロップ
Query OK, 0 rows affected (0.45 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> SELECT word, count(*) AS c FROM information_schema.INNODB_FT_INDEX_TABLE
GROUP BY word ORDER BY c DESC LIMIT 10;
+-----------+------+
| word | c |
+-----------+------+
| mysql | 7374 |
| :// | 5414 |
| http | 4629 |
| innodb | 1028 |
| という | 1016 |
| dbts | 883 |
| https | 883 |
| rkajiyama | 797 |
| mariadb | 795 |
| groonga | 681 |
+-----------+------+
10 rows in set (0.47 sec)
37/103
以前やった全⽂検索のベンチマーク
MySQLの全⽂検索に関するあれやこれや
3⾏で⾔うと
Mroongaは速いし2gramでも1⽂字検索できて便利
1gramは死ぬからMeCab使う
結果セットが⼤きくなってくるとMeCabでも死ぬ
-
38/103
はい次
39/103
オフラインモードを試すためにSuperを持ってないユーザ
ーを作る
t';
Query OK, 0 rows affected, 1 warning (0.07 sec)
mysql> SHOW WARNINGSG
*************************** 1. row ***************************
Level: Warning
Code: 1287
oved in futu
re release. Create new user with CREATE USER statement.
1 row in set (0.00 sec)
mysql> SHOW GRANTS FOR yoku0825@localhost;
+-----------------------------------------------------------------+
| Grants for yoku0825@localhost |
+-----------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'yoku0825'@'localhost' |
| GRANT ALL PRIVILEGES ON `mysqlslap`.* TO 'yoku0825'@'localhost' |
+-----------------------------------------------------------------+
2 rows in set (0.00 sec)
40/103
MySQL 5.7(あるいはsql_mode= NO_AUTO_CREATE_USER)に
怒られないユーザーの作成⽅法
mysql> CREATE USER yoku0826@localhost IDENTIFIED BY 'test';
Query OK, 0 rows affected (0.01 sec)
mysql> GRANT ALL ON mysqlslap.* TO yoku0826@localhost;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW GRANTS FOR yoku0826@localhost;
+-----------------------------------------------------------------+
| Grants for yoku0826@localhost |
+-----------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'yoku0826'@'localhost' |
| GRANT ALL PRIVILEGES ON `mysqlslap`.* TO 'yoku0826'@'localhost' |
+-----------------------------------------------------------------+
2 rows in set (0.00 sec)
41/103
mysqlslapで負荷かけながらオフラインモードにしてみる
$ mysqlslap --no-drop --auto-generate-sql --auto-generate-sql-exe
cute-number=100000 -uyoku0826 -ptest
mysqlslap: [Warning] Using a password on the command line interfa
ce can be insecure.
mysql> SET GLOBAL offline_mode= ON;
Query OK, 0 rows affected (0.00 sec)
mysqlslap: Error when storing result: 2013 Lost connection to MyS
QL server during query
mysqlslap: Cannot run query INSERT INTO t1 VALUES (95275444,'bNIr
BDBl81tjzdvuOpQRCXgX37xGtzLKEXBIcE3k7xK7aFtqxC99jqYnpTviK83bf6lGD
gsKd4R3KLmHPnI8TqnIKj1gjw7N2sXFZNS2Svyg8cpZN7atxL39w4igsp') ERRO
R : MySQL server has gone away
42/103
オフラインモードでもう⼀度mysqlslapしてみる
$ mysqlslap --no-drop --auto-generate-sql --auto-generate-sql-exe
cute-number=100000 -uyoku0826 -ptest
mysqlslap: [Warning] Using a password on the command line interfa
ce can be insecure.
mysqlslap: Error when connecting to server: The server is current
ly in offline mode
43/103
はい次
44/103
InnoDBのバッファプールサイズオンライン変更(負荷か
ける⽅)
$ mysqlslap --no-drop --auto-generate-sql --auto-generate-sql-exe
cute-number=1000000 -c 32 -uyoku0826 -ptest & mysqladmin -uroot -
r -i 1 ex | egrep "Com_(insert|select) "
[1] 1256
45/103
InnoDBのバッファプールサイズオンライン変更(MySQL
側, 増やす)
mysql> SET GLOBAL innodb_buffer_pool_size= 32 * 1024 * 1024 * 1024;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW STATUS LIKE '%resize%';
+----------------------------------+----------------------------------+
| Variable_name | Value |
+----------------------------------+----------------------------------+
| Innodb_buffer_pool_resize_status | Resizing also other hash tables. |
+----------------------------------+----------------------------------+
1 row in set (0.00 sec)
mysql> SHOW STATUS LIKE '%resize%';
+----------------------------------+----------------------------------------------------+
| Variable_name | Value |
+----------------------------------+----------------------------------------------------+
| Innodb_buffer_pool_resize_status | Completed resizing buffer pool at 151019 10:00:03. |
+----------------------------------+----------------------------------------------------+
1 row in set (0.00 sec)
46/103
増やしてる最中
| Com_insert | 144 |
| Com_select | 119 |
| Com_insert | 88 |
| Com_select | 72 |
| Com_insert | 0 |
| Com_select | 0 |
| Com_insert | 82 |
| Com_select | 68 |
| Com_insert | 150 |
| Com_select | 125 |
47/103
SELECT-Only
$ mysqlslap --no-drop --query="SELECT * FROM mysqlslap.t1 ORDER
BY RAND() LIMIT 1" --number-of-queries=1000000 -c 32 -uyoku0826
-ptest & mysqladmin -r -i 1 -uroot ex | egrep "Com_select "
..
| Com_select | 70 |
| Com_select | 74 |
| Com_select | 7 |
| Com_select | 46 |
| Com_select | 56 |
..
| Com_select | 73 |
| Com_select | 68 |
| Com_select | 24 |
| Com_select | 56 |
| Com_select | 68 |
48/103
InnoDBのバッファプールサイズオンライン変更(MySQL
側, 減らす)
mysql> SET GLOBAL innodb_buffer_pool_size= 128 * 1024 * 1024;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW STATUS LIKE '%resize%';
+----------------------------------+-----------------------------
-----------------------+
| Variable_name | Valu
e |
+----------------------------------+-----------------------------
-----------------------+
| Innodb_buffer_pool_resize_status | Completed resizing buffer po
ol at 151019 10:01:06. |
+----------------------------------+-----------------------------
-----------------------+
1 row in set (0.00 sec)
49/103
減らしてる最中
| Com_insert | 123 |
| Com_select | 100 |
| Com_insert | 112 |
| Com_select | 97 |
| Com_insert | 118 |
| Com_select | 96 |
| Com_insert | 114 |
| Com_select | 96 |
50/103
次
51/103
JSONデータ型はカラムのデータ型なので、JSONとして
有効でない値はエラーになる
mysql> CREATE TABLE t1 (val JSON);
Query OK, 0 rows affected (0.35 sec)
mysql> INSERT INTO t1 VALUES ('"[{is_this_json?}]');
ERROR 3140 (22032): Invalid JSON text: "Missing a closing quotati
on mark in string." at position 17 in value (or column) '"[{is_th
is_json?}]'.
52/103
サンプルデータを突っ込んでみる
# perl -MDBI -MConfig::Pit -MNet::Twitter::Lite::WithAPIv1_1 -MJSON -e 'my $conn
= DBI->connect("dbi:mysql:d1", "root", "", {mysql_enable_utf8 => 1}); my $twitte
r= Net::Twitter::Lite::WithAPIv1_1->new(%{pit_get("twitter")}, ssl => 1); $conn-
>do("INSERT INTO t1 VALUES (?)", undef, JSON->new()->encode($twitter->search({q
=> "from:yoku0825"})));'
mysql> SELECT val FROM t1 LIMIT 1G
*************************** 1. row ***************************
val: {"statuses": [{"id": 656334251193864192, "geo": null, "lang": "en", "text
": "RT @dimitrik_fr: A preview of the latest @MySQL 5.7 Performance results -- h
ttps://t.co/0mAxN4abHI -- stay tuned for more details ;-)n#MySQ…", "user": {"i
d": 184376567, "url": "http://t.co/iHeEe0ZUQj", "lang": "ja", "name": "yoku0825
", "id_str": "184376567", "entities": {"url": {"urls": [{"url": "http://t.co/iHe
Ee0ZUQj", "indices": [0, 22], "display_url": "yoku0825.blogspot.jp", "expanded_u
rl": "http://yoku0825.blogspot.jp/"}]}, "description": {"urls": []}}, "location
": "Japan, Tokyo", "verified": false, "following": false, "protected": false, "t
ime_zone": "Tokyo", "created_at": "Sun Aug 29 11:41:33 +0000 2010", "utc_offset
": 32400, "description": "妻とせがれと娘 とふかふかのぬいぐるみとMySQLが好き
です。本物のイルカが好きなことにも最近気づきました。", "geo_enabled": fals
e, "screen_name": "yoku0
53/103
アクセスするにはJSON関数を使う
mysql> SELECT json_keys(val) FROM t1;
+---------------------------------+
| json_keys(val) |
+---------------------------------+
| ["statuses", "search_metadata"] |
+---------------------------------+
1 row in set (0.02 sec)
mysql> SELECT json_length(val, "$.statuses") FROM t1;
+--------------------------------+
| json_length(val, "$.statuses") |
+--------------------------------+
| 15 |
+--------------------------------+
1 row in set (0.00 sec)
mysql> SELECT json_keys(val, "$.statuses[0]") FROM t1G
*************************** 1. row ***************************
json_keys(val, "$.statuses[0]"): ["id", "geo", "lang", "text", "user", "place", "id_str", "so
urce", "entities", "metadata", "favorited", "retweeted", "truncated", "created_at", "coordina
tes", "contributors", "retweet_count", "favorite_count", "is_quote_status", "retweeted_status
", "possibly_sensitive", "in_reply_to_user_id", "in_reply_to_status_id", "in_reply_to_screen_
name", "in_reply_to_user_id_str", "in_reply_to_status_id_str"]
1 row in set (0.00 sec)
54/103
アロー演算⼦はjson̲extractと等価
mysql> SELECT val->'$.statuses[*].id' FROM t1G
*************************** 1. row ***************************
val->'$.statuses[*].id': [656334251193864192, 65632248720307814
4, 656313502164914176, 656297985744044033, 656288740617273344, 65
6288011647238144, 656287478416994304, 656278339376680960, 6562771
97670318080, 656271731888287744, 656263672000483328, 656248886999
146497, 656134957589360640, 656130008205778944, 65612366700116377
7]
1 row in set (0.00 sec)
55/103
それMySQLでやる意味あるの︖
BLOB/TEXT型と⽐べて
JSONとして有効でない⽂字列をエラーにできる-
容量の最適化が⾏われているらしい-
JSONをクライアントサイドでゴニョるのに⽐べて
クライアント/サーバー間の転送量が削減できる-
サーバー内のフェッチ/更新サイズは削減できない-
generated columnが使える
56/103
テーブルUDFが欲しい
# perl -MDBI -MConfig::Pit -MNet::Twitter::Lite::WithAPIv1_1 -MJSON -e 'my $conn
= DBI->connect("dbi:mysql:d1", "root", "", {mysql_enable_utf8 => 1}); my $twitte
r= Net::Twitter::Lite::WithAPIv1_1->new(%{pit_get("twitter")}, ssl => 1); foreac
h (@{$twitter->search({q => "from:yoku0825"})->{statuses}}) {$conn->do("INSERT I
NTO t2 VALUES (?)", undef, JSON->new()->encode($_));}'
mysql> SELECT val FROM t2 WHERE val->'$.lang' = 'ja' ORDER BY val->'$.created_at
' DESC LIMIT 1G
*************************** 1. row ***************************
val: {"id": 656322487203078144, "geo": null, "lang": "ja", "text": "RT @matsumot
ory: あんちぽさんと喋るの楽しいから喋る系は良 さそう / “エンジニア採用した
さ過ぎて迷走している話 - Kentaro Kuribayashi's blog” https://t.co/YmNp7yNej4
", "user": {"id": 184376567, "url": "http://t.co/iHeEe0ZUQj", "lang": "ja", "nam
e": "yoku0825", "id_str": "184376567", "entities": {"url": {"urls": [{"url": "ht
tp://t.co/iHeEe0ZUQj", "indices": [0, 22], "display_url": "yoku0825.blogspot.jp
", "expanded_url": "http://yoku0825.blogspot.jp/"}]}, "description": {"urls":
[]}}, "location": "Japan, Tokyo", "verified": false, "following": false, "protec
ted": false, "time_zone": "Tokyo", "created_at": "Sun Aug 29 11:41:33 +0000 2010
", "utc_offset": 32400, "description": "妻とせ がれと娘とふかふかのぬいぐるみ
とMySQLが好きです。本物のイルカが好きなことにも最近気づきまし
57/103
ただの関数演算なのでJOINできる
mysql> SELECT val->'$.text', reply.text FROM t2 JOIN (SELECT val->'$.in_reply_to
_status_id' AS id, val->'$.text' AS text FROM t2 WHERE val->'$.in_reply_to_statu
s_id' IS NOT NULL) AS reply ON t2.val->'$.id' = reply.id LIMIT 5G
*************************** 1. row ***************************
val->'$.text': "enforce_storage_engine"
text: "興味を引いたのはざっとこんなもん。"
*************************** 2. row ***************************
val->'$.text': "InnoDBのデフラグ"
text: "enforce_storage_engine"
*************************** 3. row ***************************
val->'$.text': "ROLEが拡張されてデフォルトロールが指定可能に"
text: "InnoDBのデフラグ"
*************************** 4. row ***************************
val->'$.text': "RBRでもスレーブでトリガーが走る様になった"
text: "ROLEが拡張されてデフォルトロールが指定可能に"
*************************** 5. row ***************************
val->'$.text': "ロスレス準同期"
text: "RBRでもスレーブでトリガーが走る様になった"
5 rows in set (0.01 sec)
58/103
実⾏計画はもちろんお察し
mysql> explain SELECT val->'$.text', reply.text FROM t2 JOIN (SELECT val->'$.in_
reply_to_status_id' AS id, val->'$.text' AS text FROM t2 WHERE val->'$.in_reply_
to_status_id' IS NOT NULL) AS reply ON t2.val->'$.id' = reply.id;
+----+-------------+-------+------------+------+---------------+------+---------
+------+------+----------+----------------------------------------------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len
| ref | rows | filtered | Extra |
+----+-------------+-------+------------+------+---------------+------+---------
+------+------+----------+----------------------------------------------------+
| 1 | SIMPLE | t2 | NULL | ALL | NULL | NULL | NULL
| NULL | 74 | 100.00 | NULL |
| 1 | SIMPLE | t2 | NULL | ALL | NULL | NULL | NULL
| NULL | 74 | 100.00 | Using where; Using join buffer (Block Nested Loop) |
+----+-------------+-------+------------+------+---------------+------+---------
+------+------+----------+----------------------------------------------------+
2 rows in set, 1 warning (0.00 sec)
59/103
generated column #とは
mysql> ALTER TABLE t2 ADD v_id BIGINT AS (val->'$.id') NOT NULL;
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> SELECT v_id FROM t2;
+--------------------+
| v_id |
+--------------------+
| 656334251193864192 |
| 656322487203078144 |
| 656313502164914176 |
| 656297985744044033 |
| 656288740617273344 |
| 656288011647238144 |
| 656287478416994304 |
| 656278339376680960 |
| 656277197670318080 |
| 656271731888287744 |
| 656263672000483328 |
| 656248886999146497 |
| 656134957589360640 |
| 656130008205778944 |
| 656123667001163777 |
+--------------------+
15 rows in set (0.00 sec)
60/103
UNIQUE制約をつけることもできる
mysql> ALTER TABLE t2 ADD UNIQUE KEY (v_id);
Query OK, 0 rows affected (0.12 sec)
Records: 0 Duplicates: 0 Warnings: 0
61/103
カラムとして存在するので、カラム名を指定しない
INSERTと相性が悪い
# perl -MDBI -MConfig::Pit -MNet::Twitter::Lite::WithAPIv1_1 -MJS
ON -e 'my $conn= DBI->connect("dbi:mysql:d1", "root", "", {mysql_
enable_utf8 => 1}); my $twitter= Net::Twitter::Lite::WithAPIv1_1-
>new(%{pit_get("twitter")}, ssl => 1); foreach (@{$twitter->searc
h({q => "from:yoku0825", count => 100})->{statuses}}) {$conn->do
DBD::mysql::db do failed: Column count doesn't match value count
at row 1 at -e line 1.
..
62/103
ちゃんとユニーク制約違反でエラーになる
$ perl -MDBI -MConfig::Pit -MNet::Twitter::Lite::WithAPIv1_1 -MJS
ON -e 'my $conn= DBI->connect("dbi:mysql:d1", "root", "", {mysql_
enable_utf8 => 1}); my $twitter= Net::Twitter::Lite::WithAPIv1_1-
>new(%{pit_get("twitter")}, ssl => 1); foreach (@{$twitter->searc
h({q => "from:yoku0825", count => 100})->{statuses}}) {$conn->do
_
));}'
DBD::mysql::db do failed: Duplicate entry '656334251193864192' fo
r key 'v_id' at -e line 1.
..
mysql> SELECT COUNT(*) FROM t2;
+----------+
| COUNT(*) |
+----------+
| 100 |
+----------+
1 row in set (0.01 sec)
63/103
generated columnでcovering index
mysql> ALTER TABLE t2 ADD v_lang varchar(16) AS (val->'$.lang'), ADD KEY(v_lang
);
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> explain SELECT v_lang, COUNT(*) AS c FROM t2 GROUP BY v_lang;
+----+-------------+-------+------------+-------+---------------+--------+------
---+------+------+----------+-------------+
| id | select_type | table | partitions | type | possible_keys | key | key_l
en | ref | rows | filtered | Extra |
+----+-------------+-------+------------+-------+---------------+--------+------
---+------+------+----------+-------------+
| 1 | SIMPLE | t2 | NULL | index | v_lang | v_lang | 1
9 | NULL | 74 | 100.00 | Using index |
+----+-------------+-------+------------+-------+---------------+--------+------
---+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)
64/103
generated columnで全⽂検索
KEY (v_text) WITH PARSER MeCab;
t supported for generated columns.
ULLTEXT KEY (v_text) WITH PARSER MeCab;
Query OK, 100 rows affected (0.37 sec)
Records: 100 Duplicates: 0 Warnings: 0
ext) against ('MySQL') LIMIT 3G
*************************** 1. row ***************************
v_id: 654573993006010368
v_text: "RT @mysql_jp: MySQL 5.7 GAと同時にMySQL Fabricによる構成や各種レプリケーション構成
へのアクセスをシンプルにするMySQL RouterもGAとなっています https://t.co/u3e1E2OSoV #mysql_jp"
val->'$.created_at': "Mon Oct 19 14:17:58 +0000 2015"
*************************** 2. row ***************************
v_id: 654573993006010368
v_text: "RT @mysql_jp: MySQL 5.7 GAおよびMySQL Router GAなどの技術情報はMySQL 最新情報セミナ
ー2015秋にてご紹介い たします。ぜひご参加下さい。なお東京は11月9日にも第2回を開催予定です http://t.c
o/0Drp08uNbW #m…"
val->'$.created_at': "Mon Oct 19 14:22:05 +0000 2015"
*************************** 3. row ***************************
v_id: 654573993006010368
v_text: "RT @mysql_jp: MySQL 5.7の機能概要はこちらです http://t.co/FZ1Qa7HTfon新機能の一覧
はOracle ACE(MySQL)のyoku0825さんによるこちらの記事をご参照下さい https://t.co/WclCToU1Xrn#mysq…"
val->'$.created_at': "Tue Oct 20 02:00:03 +0000 2015"
3 rows in set (0.00 sec)
65/103
generated columnの計算タイミング
STORED or VIRTUAL INDEXあり INDEXなし
VIRTUAL(デフォルト) ALTER TABLE時 SELECT時
STORED ALTER TABLE時 ALTER TABLE時
66/103
逆パターン
# wget http://downloads.mysql.com/docs/world.sql.gz
# mysqladmin create world
# zcat world.sql.gz | mysql world
mysql> SELECT * FROM world.City LIMIT 3;
+----+----------+-------------+----------+------------+
| ID | Name | CountryCode | District | Population |
+----+----------+-------------+----------+------------+
| 1 | Kabul | AFG | Kabol | 1780000 |
| 2 | Qandahar | AFG | Qandahar | 237500 |
| 3 | Herat | AFG | Herat | 186800 |
+----+----------+-------------+----------+------------+
3 rows in set (0.00 sec)
67/103
generated columnでJSONにしてしまう
mysql> ALTER TABLE City ADD v_json BLOB AS (json_object('name', N
ame, 'countrycode', CountryCode, 'district', District, 'populatio
n', Population)) STORED;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> SELECT v_json FROM City LIMIT 3G
*************************** 1. row ***************************
v_json: {"name": "Kabul", "district": "Kabol", "population": 1780
000, "countrycode": "AFG"}
*************************** 2. row ***************************
v_json: {"name": "Qandahar", "district": "Qandahar", "population
": 237500, "countrycode": "AFG"}
*************************** 3. row ***************************
v_json: {"name": "Herat", "district": "Herat", "population": 1868
00, "countrycode": "AFG"}
3 rows in set (0.00 sec)
68/103
挙句InnoDB Memcached(JSON型だと結果がおかしく
なったのでBLOB型でSTORED)
# mysql < /usr/share/mysql/innodb_memcached_config.sql
mysql> INSTALL PLUGIN daemon_memcached SONAME "libmemcached.so";
mysql> ALTER TABLE world.City ADD c1 int DEFAULT 0, ADD c2 bigint DEFAUL
T 0, ADD c3 int DEFAULT 0;
Query OK, 0 rows affected (0.23 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> DELETE FROM innodb_memcache.containers;
mysql> INSERT INTO innodb_memcache.containers VALUES ('world_json', 'wor
ld', 'City', 'ID', 'v_json', 'c1', 'c2', 'c3', 'PRIMARY');
# service mysqld restart
# memcat --servers=127.0.0.1:11211 1
{"name": "Kabul", "district": "Kabol", "population": 1780000, "countryco
de": "AFG"}
69/103
範囲検索でORDER BYまでキーが使えないやつも
mysql> ALTER TABLE Country ADD KEY (population, gnp);
Query OK, 0 rows affected (0.03 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> explain SELECT Name FROM Country WHERE Population > 100000000 ORD
ER BY GNP DESC;
+----+-------------+---------+------------+-------+---------------+-----
-------+---------+------+------+----------+-----------------------------
----------+
| id | select_type | table | partitions | type | possible_keys | ke
y | key_len | ref | rows | filtered | Extr
a |
+----+-------------+---------+------------+-------+---------------+-----
-------+---------+------+------+----------+-----------------------------
----------+
| 1 | SIMPLE | Country | NULL | range | Population | Popu
lation | 4 | NULL | 10 | 100.00 | Using index condition; Usin
g filesort |
+----+-------------+---------+------------+-------+---------------+-----
-------+---------+------+------+----------+-----------------------------
----------+
1 row in set, 1 warning (0.00 sec)
70/103
generated columnならこの通り
mysql> ALTER TABLE Country ADD is_over_100mil tinyint AS (IF(Population > 100000
00, 1, 0)), ADD KEY (is_over_100mil, GNP);
Query OK, 0 rows affected (0.03 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> explain SELECT Name FROM Country WHERE is_over_100mil = 1 ORDER BY GNP DE
SC;
+----+-------------+---------+------------+------+----------------+-------------
---+---------+-------+------+----------+-------------+
| id | select_type | table | partitions | type | possible_keys | ke
y | key_len | ref | rows | filtered | Extra |
+----+-------------+---------+------------+------+----------------+-------------
---+---------+-------+------+----------+-------------+
| 1 | SIMPLE | Country | NULL | ref | is_over_100mil | is_over_100m
il | 2 | const | 78 | 100.00 | Using where |
+----+-------------+---------+------------+------+----------------+-------------
---+---------+-------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)
71/103
昇順と降順が混じったソートも
mysql> ALTER TABLE Country ADD KEY (is_over_100mil, GNP, GNPOld);
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> explain SELECT Name FROM Country USE INDEX(is_over_100mil_2) WHERE is_ove
r_100mil = 1 ORDER BY GNP ASC, GNPOld DESC LIMIT 1;
+----+-------------+---------+------------+------+------------------+-----------
-------+---------+-------+------+----------+-----------------------------+
| id | select_type | table | partitions | type | possible_keys | ke
y | key_len | ref | rows | filtered | Extr
a |
+----+-------------+---------+------------+------+------------------+-----------
-------+---------+-------+------+----------+-----------------------------+
| 1 | SIMPLE | Country | NULL | ref | is_over_100mil_2 | is_over_10
0mil_2 | 2 | const | 78 | 100.00 | Using where; Using filesort |
+----+-------------+---------+------------+------+------------------+-----------
-------+---------+-------+------+----------+-----------------------------+
1 row in set, 1 warning (0.00 sec)
72/103
generated columnならこの通り
mysql> ALTER TABLE Country ADD invert_gnpold float(10, 2) AS (0 - GNPOld), ADD K
EY (is_over_100mil, GNP, invert_gnpold);
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> explain SELECT Name FROM Country WHERE is_over_100mil = 1 ORDER BY GNP AS
C, invert_gnpold ASC LIMIT 1;
+----+-------------+---------+------------+------+------------------------------
--------------------+------------------+---------+-------+------+----------+----
---------+
| id | select_type | table | partitions | type | possible_key
s | key | key_len | ref | row
s | filtered | Extra |
+----+-------------+---------+------------+------+------------------------------
--------------------+------------------+---------+-------+------+----------+----
---------+
| 1 | SIMPLE | Country | NULL | ref | is_over_100mil,is_over_100mil
_2,is_over_100mil_3 | is_over_100mil_3 | 2 | const | 78 | 100.00 | Usi
ng where |
+----+-------------+---------+------------+------+------------------------------
--------------------+------------------+---------+-------+------+----------+----
---------+
1 row in set, 1 warning (0.00 sec)
73/103
MySQLにないCHECK制約もgenerated columnならこ
の通り
mysql> ALTER TABLE Country ADD v_check tinyint AS (IF(GNPOld <
1, NULL, 1)) NOT NULL;
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> INSERT INTO Country SET Name= 'Dummy', GNPOld= 0.01;
ERROR 1048 (23000): Column 'v_check' cannot be null
mysql> INSERT INTO Country SET Name= 'Dummy', GNPOld= 1000.01;
Query OK, 1 row affected (0.00 sec)
74/103
夢は無限
⼤
75/103
はい次
76/103
レプリケーション関連のあれこれを遊ぶには
MySQL::Sandboxがべんり
# /usr/local/bin/cpanm MySQL::Sandbox
# export PATH=$PATH:/usr/local/bin
# wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.8-r
c-linux-glibc2.5-x86_64.tar.gz
# SANDBOX_AS_ROOT=1 make_replication_sandbox mysql-5.7.8-rc-linux
-glibc2.5-x86_64.tar.gz
# cd ~/sandboxes/rsandbox_mysql-5_7_8/
77/103
GTIDのオンライン有効化
今まで
gtid̲modeは起動時パラメーター(SET GLOBAL不可)
masterslave gtid-mode= OFF gtid-mode= ON
gtid-mode= OFF ○ ×
gtid-mode= ON × ○
78/103
GTIDのオンライン有効化
5.7
gtid̲modeはダイナミックパラメーター(SET GLOBAL可)
masterslave OFF OFF̲PERMISSIVE ON̲PERMISSIVE ON
OFF ○ ○ ○ ×
OFF̲PERMIS
SIVE
○ ○ ○ ×
ON̲PERMISS
IVE
× ○ ○ ○
ON × ○ ○ ○
79/103
MySQL::Sandboxで起動したてはgtid_mode= OFF
# ./use_all "SELECT @@gtid_mode"
# master
@@gtid_mode
OFF
# server: 1:
@@gtid_mode
OFF
# server: 2:
@@gtid_mode
OFF
80/103
負荷をかけながらgtid_mode= ONにもっていく
# mysqlslap -S /tmp/mysql_sandbox13253.sock -umsandbox -pmsandbo
x --auto-generate-sql --auto-generate-sql-execute-number=1000000
-c 2 & mysqladmin -uroot -pmsandbox -S /tmp/mysql_sandbox13253.so
ck -r -i 1 ex | egrep "Com_(insert|select) "
81/103
gtid_mode= OFF_PERMISSIVE
# ./m -e "SET GLOBAL gtid_mode= OFF_PERMISSIVE"
# ./s1 -e "SET GLOBAL gtid_mode= OFF_PERMISSIVE"
# ./s2 -e "SET GLOBAL gtid_mode= OFF_PERMISSIVE"
# ./use_all "SELECT @@gtid_mode"
# master
@@gtid_mode
OFF_PERMISSIVE
# server: 1:
@@gtid_mode
OFF_PERMISSIVE
# server: 2:
@@gtid_mode
OFF_PERMISSIVE
82/103
GTIDは振られない(が、GTIDが有効なマスターに接続し
ても⽂句は⾔わない)
# at 2748010
#151021 11:06:35 server id 1 end_log_pos 2748075 CRC32 0x367e304
1 Anonymous_GTID last_committed=6992 sequence_number=69
93
SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/;
# at 2748075
#151021 11:06:35 server id 1 end_log_pos 2748152 CRC32 0x916da7a
5 Query thread_id=16 exec_time=0 error_code=0
SET TIMESTAMP=1445393195/*!*/;
BEGIN
/*!*/;
..
# at 2748372
#151021 11:06:35 server id 1 end_log_pos 2748403 CRC32 0x5fa8c12
b Xid = 51208
COMMIT/*!*/;
83/103
gtid_mode= ON_PERMISSIVE
# ./m -e "SET GLOBAL gtid_mode= ON_PERMISSIVE"
# ./s1 -e "SET GLOBAL gtid_mode= ON_PERMISSIVE"
# ./use_all "SELECT @@gtid_mode"
# master
@@gtid_mode
ON_PERMISSIVE
# server: 1:
@@gtid_mode
ON_PERMISSIVE
# server: 2:
@@gtid_mode
OFF_PERMISSIVE
84/103
GTIDを振るようになる(が、GTIDが有効でないスレーブ
がいても⽂句は⾔わない)
# at 997588
#151021 11:09:16 server id 1 end_log_pos 997653 CRC32 0x985a4456
GTID last_committed=2538 sequence_number=2539
SET @@SESSION.GTID_NEXT= '00013253-1111-1111-1111-111111111111:2539'/*!
*/;
# at 997653
#151021 11:09:16 server id 1 end_log_pos 997730 CRC32 0xed08a25b
Query thread_id=15 exec_time=0 error_code=0
SET TIMESTAMP=1445393356/*!*/;
BEGIN
/*!*/;
..
# at 997950
#151021 11:09:16 server id 1 end_log_pos 997981 CRC32 0xc3bfdb4c
Xid = 68724
COMMIT/*!*/;
85/103
1台だけgtid_mode= OFF_PERMISSIVEでも⽂句を⾔ってない
# ./check_slaves
master
port: 13253
File: mysql-bin.000003
Position: 3236509
slave # 1
port: 13254
Master_Log_File: mysql-bin.000003
Read_Master_Log_Pos: 3236509
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Exec_Master_Log_Pos: 3236509
slave # 2
port: 13255
Master_Log_File: mysql-bin.000003
Read_Master_Log_Pos: 3236509
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Exec_Master_Log_Pos: 3236509
86/103
gtid_mode= ONの前に
# ./m -e "SET GLOBAL gtid_mode= ON"
ERROR 3111 (HY000) at line 1: SET @@GLOBAL.GTID_MODE = ON is no
t allowed because ENFORCE_GTID_CONSISTENCY is not ON.
# ./use_all "SELECT @@enforce_gtid_consistency"
# master
@@enforce_gtid_consistency
OFF
# server: 1:
@@enforce_gtid_consistency
OFF
# server: 2:
@@enforce_gtid_consistency
OFF
87/103
enforce_gtid_consistency= ONの前にWARNで様⼦を⾒
る
mysql> SELECT @@enforce_gtid_consistency;
+----------------------------+
| @@enforce_gtid_consistency |
+----------------------------+
| WARN |
+----------------------------+
1 row in set (0.00 sec)
mysql> CREATE TABLE t2 AS SELECT * FROM t1;
Query OK, 1 row affected, 1 warning (0.04 sec)
Records: 1 Duplicates: 0 Warnings: 1
mysql> SHOW WARNINGS;
+---------+------+---------------------------------------------------------------+
| Level | Code | Message |
+---------+------+---------------------------------------------------------------+
| Warning | 1786 | Statement violates GTID consistency: CREATE TABLE ... SELECT. |
+---------+------+---------------------------------------------------------------+
1 row in set (0.00 sec)
88/103
gtid_mode= ON
# ./m -e "SET GLOBAL gtid_mode= ON"
# ./use_all "SELECT @@gtid_mode"
# master
@@gtid_mode
ON
# server: 1:
@@gtid_mode
ON_PERMISSIVE
# server: 2:
@@gtid_mode
OFF_PERMISSIVE
# ./check_slaves
89/103
ここまでホントに無停⽌
gtid_modeを変更するたびにbinlogのローテートはされる
CHANGE MASTER TO master_auto_position= 1にはSTOP SLAVE
が必要
90/103
次
91/103
シングルスレッドなレプリケーション
92/103
マルチスレッドレプリケーション(MTS)
93/103
マルチソースレプリケーション
94/103
マルチソースレプリケーション
RESET MASTER, gtid_modeは⾯倒だからやってるだけで、必須
ではないです
# SANDBOX_AS_ROOT=1 make_multiple_sandbox 5.7.8
# cd ~/sandboxes/multi_msb_5_7_8/
# ./use_all "RESET MASTER"
# ./use_all "SET GLOBAL enforce_gtid_consistency= ON"
# ./use_all "SET GLOBAL gtid_mode= OFF_PERMISSIVE"
# ./use_all "SET GLOBAL gtid_mode= ON_PERMISSIVE"
# ./use_all "SET GLOBAL gtid_mode= ON"
95/103
チャンネルを指定してCHANGE MASTER TO
# ./n1 -e "CHANGE MASTER TO master_host= '127.0.0.1', master_port= 838
0, master_user= 'msandbox', master_password= 'msandbox', master_auto_pos
ition= 1 FOR CHANNEL 'node2'"
ERROR 3077 (HY000) at line 1: To have multiple channels, repository cann
ot be of type FILE; Please check the repository configuration and conver
t them to TABLE.
# ./n1 -e "SET GLOBAL master_info_repository= 'TABLE'"
# ./n1 -e "SET GLOBAL relay_log_info_repository= 'TABLE'"
# ./n1 -e "CHANGE MASTER TO master_host= '127.0.0.1', master_port= 838
0, master_user= 'msandbox', master_password= 'msandbox', master_auto_pos
ition= 1 FOR CHANNEL 'node2'"
# ./n1 -e "CHANGE MASTER TO master_host= '127.0.0.1', master_port= 838
1, master_user= 'msandbox', master_password= 'msandbox', master_auto_pos
ition= 1 FOR CHANNEL 'node3'"
# ./n1 -Ee "SHOW SLAVE STATUS"
# ./n1 -Ee "SHOW SLAVE STATUS FOR CHANNEL 'node2'"
# ./n1 -Ee "SHOW SLAVE STATUS FOR CHANNEL 'node3'"
96/103
レプリカされてる
# ./n1 -e "START SLAVE"
# mysqlslap --no-drop -S /tmp/mysql_sandbox8380.sock -umsandbox
-pmsandbox --auto-generate-sql --create-schema=node2
# mysqlslap --no-drop -S /tmp/mysql_sandbox8381.sock -umsandbox
-pmsandbox --auto-generate-sql --create-schema=node3
# ./use_all "SHOW DATABASES LIKE 'node%'"
# server: 1:
Database (node%)
node2
node3
# server: 2:
Database (node%)
node2
# server: 3:
Database (node%)
node3
97/103
⾯⽩そうなこ
とはいっぱい
98/103
罠もいっ
ぱい
99/103
参考URL
MySQL :: MySQL 5.7 Reference Manual :: 1.4 What Is
New in MySQL 5.7
MySQL :: MySQL 5.7 Release Notes
Complete list of new features in MySQL 5.7
中の⼈が作った「新機能完全リスト」-
MySQL 5.7の新機能完全リスト | Yakst
↑をがんばって⽇本語に訳したヤーツ-
⽇々の覚書: 5.7
yoku0825ʼs Presentations on SlideShare
100/103
その他の情報源
MySQL 5.7を本番で使いそうな話に興味のある⼈は
MySQL 最新情報セミナー2015秋-
MySQL 5.7関係なく、⽇本MySQLユーザ会は15周年です :)
⽇本MySQLユーザ会会15周年記念パーティー -
connpass
-
MySQLで全⽂検索ができるMroongaのカンファレンスはこ
ちら
Groonga Meatup 2015 - Groonga | Doorkeeper-
101/103
その他の情報源
⽇本MySQLユーザ会のブースは本⽇だけですが
わたしはこの後懇親会に⾏きます。
MroongaとPGroongaの開発者の⼈もいるよ :)-
102/103
Questions
and/or
Suggestions?
103/103

More Related Content

What's hot

Effective Data Lakes - ユースケースとデザインパターン
Effective Data Lakes - ユースケースとデザインパターンEffective Data Lakes - ユースケースとデザインパターン
Effective Data Lakes - ユースケースとデザインパターンNoritaka Sekiyama
 
Gaming on aws 〜ゲームにおけるAWS最新活用術〜
Gaming on aws 〜ゲームにおけるAWS最新活用術〜Gaming on aws 〜ゲームにおけるAWS最新活用術〜
Gaming on aws 〜ゲームにおけるAWS最新活用術〜Amazon Web Services Japan
 
Elasticsearchインデクシングのパフォーマンスを測ってみた
Elasticsearchインデクシングのパフォーマンスを測ってみたElasticsearchインデクシングのパフォーマンスを測ってみた
Elasticsearchインデクシングのパフォーマンスを測ってみたRyoji Kurosawa
 
分析指向データレイク実現の次の一手 ~Delta Lake、なにそれおいしいの?~(NTTデータ テクノロジーカンファレンス 2020 発表資料)
分析指向データレイク実現の次の一手 ~Delta Lake、なにそれおいしいの?~(NTTデータ テクノロジーカンファレンス 2020 発表資料)分析指向データレイク実現の次の一手 ~Delta Lake、なにそれおいしいの?~(NTTデータ テクノロジーカンファレンス 2020 発表資料)
分析指向データレイク実現の次の一手 ~Delta Lake、なにそれおいしいの?~(NTTデータ テクノロジーカンファレンス 2020 発表資料)NTT DATA Technology & Innovation
 
おひとりさまAWS Organizationsのススメ
おひとりさまAWS OrganizationsのススメおひとりさまAWS Organizationsのススメ
おひとりさまAWS OrganizationsのススメMakio Tsukamoto
 
AWS Glueを使った Serverless ETL の実装パターン
AWS Glueを使った Serverless ETL の実装パターンAWS Glueを使った Serverless ETL の実装パターン
AWS Glueを使った Serverless ETL の実装パターンseiichi arai
 
SQLチューニング入門 入門編
SQLチューニング入門 入門編SQLチューニング入門 入門編
SQLチューニング入門 入門編Miki Shimogai
 
BigData Architecture for Azure
BigData Architecture for AzureBigData Architecture for Azure
BigData Architecture for AzureRyoma Nagata
 
Amazon Redshift로 데이터웨어하우스(DW) 구축하기
Amazon Redshift로 데이터웨어하우스(DW) 구축하기Amazon Redshift로 데이터웨어하우스(DW) 구축하기
Amazon Redshift로 데이터웨어하우스(DW) 구축하기Amazon Web Services Korea
 
Elasticsearchを使うときの注意点 公開用スライド
Elasticsearchを使うときの注意点 公開用スライドElasticsearchを使うときの注意点 公開用スライド
Elasticsearchを使うときの注意点 公開用スライド崇介 藤井
 
20221111_JPUG_CustomScan_API
20221111_JPUG_CustomScan_API20221111_JPUG_CustomScan_API
20221111_JPUG_CustomScan_APIKohei KaiGai
 
pg_bigm(ピージー・バイグラム)を用いた全文検索のしくみ(後編)
pg_bigm(ピージー・バイグラム)を用いた全文検索のしくみ(後編)pg_bigm(ピージー・バイグラム)を用いた全文検索のしくみ(後編)
pg_bigm(ピージー・バイグラム)を用いた全文検索のしくみ(後編)Masahiko Sawada
 
Best Practices for Running PostgreSQL on AWS
Best Practices for Running PostgreSQL on AWSBest Practices for Running PostgreSQL on AWS
Best Practices for Running PostgreSQL on AWSAmazon Web Services Japan
 
リクルートテクノロジーズ における EMR の活用とコスト圧縮方法
リクルートテクノロジーズ における EMR の活用とコスト圧縮方法リクルートテクノロジーズ における EMR の活用とコスト圧縮方法
リクルートテクノロジーズ における EMR の活用とコスト圧縮方法Tetsutaro Watanabe
 
Cassandraバージョンアップ&移設
Cassandraバージョンアップ&移設Cassandraバージョンアップ&移設
Cassandraバージョンアップ&移設Takehiro Torigaki
 
AWS Black Belt Tech シリーズ 2015 - AWS Data Pipeline
AWS Black Belt Tech シリーズ 2015 - AWS Data PipelineAWS Black Belt Tech シリーズ 2015 - AWS Data Pipeline
AWS Black Belt Tech シリーズ 2015 - AWS Data PipelineAmazon Web Services Japan
 
AWS Black Belt Techシリーズ AWS Key Management Service
AWS Black Belt Techシリーズ AWS Key Management ServiceAWS Black Belt Techシリーズ AWS Key Management Service
AWS Black Belt Techシリーズ AWS Key Management ServiceAmazon Web Services Japan
 
MariaDBとMroongaで作る全言語対応超高速全文検索システム
MariaDBとMroongaで作る全言語対応超高速全文検索システムMariaDBとMroongaで作る全言語対応超高速全文検索システム
MariaDBとMroongaで作る全言語対応超高速全文検索システムKouhei Sutou
 
[Cloud OnAir] Google Cloud における RDBMS の運用パターン 2020年11月19日 放送
[Cloud OnAir] Google Cloud における RDBMS の運用パターン 2020年11月19日 放送[Cloud OnAir] Google Cloud における RDBMS の運用パターン 2020年11月19日 放送
[Cloud OnAir] Google Cloud における RDBMS の運用パターン 2020年11月19日 放送Google Cloud Platform - Japan
 

What's hot (20)

Effective Data Lakes - ユースケースとデザインパターン
Effective Data Lakes - ユースケースとデザインパターンEffective Data Lakes - ユースケースとデザインパターン
Effective Data Lakes - ユースケースとデザインパターン
 
Gaming on aws 〜ゲームにおけるAWS最新活用術〜
Gaming on aws 〜ゲームにおけるAWS最新活用術〜Gaming on aws 〜ゲームにおけるAWS最新活用術〜
Gaming on aws 〜ゲームにおけるAWS最新活用術〜
 
Elasticsearchインデクシングのパフォーマンスを測ってみた
Elasticsearchインデクシングのパフォーマンスを測ってみたElasticsearchインデクシングのパフォーマンスを測ってみた
Elasticsearchインデクシングのパフォーマンスを測ってみた
 
分析指向データレイク実現の次の一手 ~Delta Lake、なにそれおいしいの?~(NTTデータ テクノロジーカンファレンス 2020 発表資料)
分析指向データレイク実現の次の一手 ~Delta Lake、なにそれおいしいの?~(NTTデータ テクノロジーカンファレンス 2020 発表資料)分析指向データレイク実現の次の一手 ~Delta Lake、なにそれおいしいの?~(NTTデータ テクノロジーカンファレンス 2020 発表資料)
分析指向データレイク実現の次の一手 ~Delta Lake、なにそれおいしいの?~(NTTデータ テクノロジーカンファレンス 2020 発表資料)
 
おひとりさまAWS Organizationsのススメ
おひとりさまAWS OrganizationsのススメおひとりさまAWS Organizationsのススメ
おひとりさまAWS Organizationsのススメ
 
AWS Glueを使った Serverless ETL の実装パターン
AWS Glueを使った Serverless ETL の実装パターンAWS Glueを使った Serverless ETL の実装パターン
AWS Glueを使った Serverless ETL の実装パターン
 
SQLチューニング入門 入門編
SQLチューニング入門 入門編SQLチューニング入門 入門編
SQLチューニング入門 入門編
 
BigData Architecture for Azure
BigData Architecture for AzureBigData Architecture for Azure
BigData Architecture for Azure
 
Amazon Redshift로 데이터웨어하우스(DW) 구축하기
Amazon Redshift로 데이터웨어하우스(DW) 구축하기Amazon Redshift로 데이터웨어하우스(DW) 구축하기
Amazon Redshift로 데이터웨어하우스(DW) 구축하기
 
Elasticsearchを使うときの注意点 公開用スライド
Elasticsearchを使うときの注意点 公開用スライドElasticsearchを使うときの注意点 公開用スライド
Elasticsearchを使うときの注意点 公開用スライド
 
20221111_JPUG_CustomScan_API
20221111_JPUG_CustomScan_API20221111_JPUG_CustomScan_API
20221111_JPUG_CustomScan_API
 
pg_bigm(ピージー・バイグラム)を用いた全文検索のしくみ(後編)
pg_bigm(ピージー・バイグラム)を用いた全文検索のしくみ(後編)pg_bigm(ピージー・バイグラム)を用いた全文検索のしくみ(後編)
pg_bigm(ピージー・バイグラム)を用いた全文検索のしくみ(後編)
 
Best Practices for Running PostgreSQL on AWS
Best Practices for Running PostgreSQL on AWSBest Practices for Running PostgreSQL on AWS
Best Practices for Running PostgreSQL on AWS
 
リクルートテクノロジーズ における EMR の活用とコスト圧縮方法
リクルートテクノロジーズ における EMR の活用とコスト圧縮方法リクルートテクノロジーズ における EMR の活用とコスト圧縮方法
リクルートテクノロジーズ における EMR の活用とコスト圧縮方法
 
Cassandraバージョンアップ&移設
Cassandraバージョンアップ&移設Cassandraバージョンアップ&移設
Cassandraバージョンアップ&移設
 
AWS Black Belt Tech シリーズ 2015 - AWS Data Pipeline
AWS Black Belt Tech シリーズ 2015 - AWS Data PipelineAWS Black Belt Tech シリーズ 2015 - AWS Data Pipeline
AWS Black Belt Tech シリーズ 2015 - AWS Data Pipeline
 
AWS Black Belt Techシリーズ AWS Key Management Service
AWS Black Belt Techシリーズ AWS Key Management ServiceAWS Black Belt Techシリーズ AWS Key Management Service
AWS Black Belt Techシリーズ AWS Key Management Service
 
各種データベースの特徴とパフォーマンス比較
各種データベースの特徴とパフォーマンス比較各種データベースの特徴とパフォーマンス比較
各種データベースの特徴とパフォーマンス比較
 
MariaDBとMroongaで作る全言語対応超高速全文検索システム
MariaDBとMroongaで作る全言語対応超高速全文検索システムMariaDBとMroongaで作る全言語対応超高速全文検索システム
MariaDBとMroongaで作る全言語対応超高速全文検索システム
 
[Cloud OnAir] Google Cloud における RDBMS の運用パターン 2020年11月19日 放送
[Cloud OnAir] Google Cloud における RDBMS の運用パターン 2020年11月19日 放送[Cloud OnAir] Google Cloud における RDBMS の運用パターン 2020年11月19日 放送
[Cloud OnAir] Google Cloud における RDBMS の運用パターン 2020年11月19日 放送
 

Viewers also liked

MySQLやSSDとかの話・前編
MySQLやSSDとかの話・前編MySQLやSSDとかの話・前編
MySQLやSSDとかの話・前編gree_tech
 
MySQLやSSDとかの話・後編
MySQLやSSDとかの話・後編MySQLやSSDとかの話・後編
MySQLやSSDとかの話・後編gree_tech
 
MySQL 5.7にやられないためにおぼえておいてほしいこと
MySQL 5.7にやられないためにおぼえておいてほしいことMySQL 5.7にやられないためにおぼえておいてほしいこと
MySQL 5.7にやられないためにおぼえておいてほしいことyoku0825
 
MySQL 5.7の罠があなたを狙っている
MySQL 5.7の罠があなたを狙っているMySQL 5.7の罠があなたを狙っている
MySQL 5.7の罠があなたを狙っているyoku0825
 
MySQLの全文検索に関するあれやこれや
MySQLの全文検索に関するあれやこれやMySQLの全文検索に関するあれやこれや
MySQLの全文検索に関するあれやこれやyoku0825
 
地雷職人の朝は早い
地雷職人の朝は早い地雷職人の朝は早い
地雷職人の朝は早いyoku0825
 
ぐだぐだInnoDB
ぐだぐだInnoDBぐだぐだInnoDB
ぐだぐだInnoDByoku0825
 
DS masakari talks
DS masakari talksDS masakari talks
DS masakari talksyoku0825
 
イルカさんチームからゾウさんチームに教えたいMySQLレプリケーション
イルカさんチームからゾウさんチームに教えたいMySQLレプリケーションイルカさんチームからゾウさんチームに教えたいMySQLレプリケーション
イルカさんチームからゾウさんチームに教えたいMySQLレプリケーションyoku0825
 
MySQL 5.7が魅せる新しい運用の形
MySQL 5.7が魅せる新しい運用の形MySQL 5.7が魅せる新しい運用の形
MySQL 5.7が魅せる新しい運用の形yoku0825
 
MySQL5.7とMariaDB10.1の性能比較(簡易)
MySQL5.7とMariaDB10.1の性能比較(簡易)MySQL5.7とMariaDB10.1の性能比較(簡易)
MySQL5.7とMariaDB10.1の性能比較(簡易)hiroi10
 
MySQL5.6と5.7性能比較
MySQL5.6と5.7性能比較MySQL5.6と5.7性能比較
MySQL5.6と5.7性能比較hiroi10
 
とあるイルカの近況報告
とあるイルカの近況報告とあるイルカの近況報告
とあるイルカの近況報告yoku0825
 
MySQLで論理削除と正しく付き合う方法
MySQLで論理削除と正しく付き合う方法MySQLで論理削除と正しく付き合う方法
MySQLで論理削除と正しく付き合う方法yoku0825
 
Tritonn (MySQL5.0.87+Senna)からの mroonga (MySQL5.6) 移行体験記
Tritonn (MySQL5.0.87+Senna)からの mroonga (MySQL5.6) 移行体験記Tritonn (MySQL5.0.87+Senna)からの mroonga (MySQL5.6) 移行体験記
Tritonn (MySQL5.0.87+Senna)からの mroonga (MySQL5.6) 移行体験記Kentaro Yoshida
 
MySQL 5.6への完全移行を実現したTritonnからMroongaへの移行体験記
MySQL 5.6への完全移行を実現したTritonnからMroongaへの移行体験記MySQL 5.6への完全移行を実現したTritonnからMroongaへの移行体験記
MySQL 5.6への完全移行を実現したTritonnからMroongaへの移行体験記Kentaro Yoshida
 
Product Search in Magento 2
Product Search in Magento 2Product Search in Magento 2
Product Search in Magento 2Sonja Riesterer
 
wakateweb vagrant aws
wakateweb vagrant awswakateweb vagrant aws
wakateweb vagrant awsYuma Iwasaki
 
MariaDB Server Compatibility with MySQL
MariaDB Server Compatibility with MySQLMariaDB Server Compatibility with MySQL
MariaDB Server Compatibility with MySQLColin Charles
 

Viewers also liked (20)

MySQLやSSDとかの話・前編
MySQLやSSDとかの話・前編MySQLやSSDとかの話・前編
MySQLやSSDとかの話・前編
 
MySQLやSSDとかの話・後編
MySQLやSSDとかの話・後編MySQLやSSDとかの話・後編
MySQLやSSDとかの話・後編
 
MySQL 5.7にやられないためにおぼえておいてほしいこと
MySQL 5.7にやられないためにおぼえておいてほしいことMySQL 5.7にやられないためにおぼえておいてほしいこと
MySQL 5.7にやられないためにおぼえておいてほしいこと
 
MySQL 5.7の罠があなたを狙っている
MySQL 5.7の罠があなたを狙っているMySQL 5.7の罠があなたを狙っている
MySQL 5.7の罠があなたを狙っている
 
MySQLの全文検索に関するあれやこれや
MySQLの全文検索に関するあれやこれやMySQLの全文検索に関するあれやこれや
MySQLの全文検索に関するあれやこれや
 
地雷職人の朝は早い
地雷職人の朝は早い地雷職人の朝は早い
地雷職人の朝は早い
 
🍣=🍺
🍣=🍺🍣=🍺
🍣=🍺
 
ぐだぐだInnoDB
ぐだぐだInnoDBぐだぐだInnoDB
ぐだぐだInnoDB
 
DS masakari talks
DS masakari talksDS masakari talks
DS masakari talks
 
イルカさんチームからゾウさんチームに教えたいMySQLレプリケーション
イルカさんチームからゾウさんチームに教えたいMySQLレプリケーションイルカさんチームからゾウさんチームに教えたいMySQLレプリケーション
イルカさんチームからゾウさんチームに教えたいMySQLレプリケーション
 
MySQL 5.7が魅せる新しい運用の形
MySQL 5.7が魅せる新しい運用の形MySQL 5.7が魅せる新しい運用の形
MySQL 5.7が魅せる新しい運用の形
 
MySQL5.7とMariaDB10.1の性能比較(簡易)
MySQL5.7とMariaDB10.1の性能比較(簡易)MySQL5.7とMariaDB10.1の性能比較(簡易)
MySQL5.7とMariaDB10.1の性能比較(簡易)
 
MySQL5.6と5.7性能比較
MySQL5.6と5.7性能比較MySQL5.6と5.7性能比較
MySQL5.6と5.7性能比較
 
とあるイルカの近況報告
とあるイルカの近況報告とあるイルカの近況報告
とあるイルカの近況報告
 
MySQLで論理削除と正しく付き合う方法
MySQLで論理削除と正しく付き合う方法MySQLで論理削除と正しく付き合う方法
MySQLで論理削除と正しく付き合う方法
 
Tritonn (MySQL5.0.87+Senna)からの mroonga (MySQL5.6) 移行体験記
Tritonn (MySQL5.0.87+Senna)からの mroonga (MySQL5.6) 移行体験記Tritonn (MySQL5.0.87+Senna)からの mroonga (MySQL5.6) 移行体験記
Tritonn (MySQL5.0.87+Senna)からの mroonga (MySQL5.6) 移行体験記
 
MySQL 5.6への完全移行を実現したTritonnからMroongaへの移行体験記
MySQL 5.6への完全移行を実現したTritonnからMroongaへの移行体験記MySQL 5.6への完全移行を実現したTritonnからMroongaへの移行体験記
MySQL 5.6への完全移行を実現したTritonnからMroongaへの移行体験記
 
Product Search in Magento 2
Product Search in Magento 2Product Search in Magento 2
Product Search in Magento 2
 
wakateweb vagrant aws
wakateweb vagrant awswakateweb vagrant aws
wakateweb vagrant aws
 
MariaDB Server Compatibility with MySQL
MariaDB Server Compatibility with MySQLMariaDB Server Compatibility with MySQL
MariaDB Server Compatibility with MySQL
 

Similar to MySQL5.7で遊んでみよう

MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 MinutesSveta Smirnova
 
16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboards16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboardsDenis Ristic
 
MySQL 5.7 innodb_enhance_partii_20160527
MySQL 5.7 innodb_enhance_partii_20160527MySQL 5.7 innodb_enhance_partii_20160527
MySQL 5.7 innodb_enhance_partii_20160527Saewoong Lee
 
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)Tesora
 
OSMC 2008 | Monitoring MySQL by Geert Vanderkelen
OSMC 2008 | Monitoring MySQL by Geert VanderkelenOSMC 2008 | Monitoring MySQL by Geert Vanderkelen
OSMC 2008 | Monitoring MySQL by Geert VanderkelenNETWAYS
 
Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingSveta Smirnova
 
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
 Design and Develop SQL DDL statements which demonstrate the use of SQL objec... Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...bhavesh lande
 
Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingSveta Smirnova
 
MySQL Idiosyncrasies That Bite SF
MySQL Idiosyncrasies That Bite SFMySQL Idiosyncrasies That Bite SF
MySQL Idiosyncrasies That Bite SFRonald Bradford
 
MySQL Kitchen : spice up your everyday SQL queries
MySQL Kitchen : spice up your everyday SQL queriesMySQL Kitchen : spice up your everyday SQL queries
MySQL Kitchen : spice up your everyday SQL queriesDamien Seguy
 
ProxySQL & PXC(Query routing and Failover Test)
ProxySQL & PXC(Query routing and Failover Test)ProxySQL & PXC(Query routing and Failover Test)
ProxySQL & PXC(Query routing and Failover Test)YoungHeon (Roy) Kim
 
Memcached Functions For My Sql Seemless Caching In My Sql
Memcached Functions For My Sql Seemless Caching In My SqlMemcached Functions For My Sql Seemless Caching In My Sql
Memcached Functions For My Sql Seemless Caching In My SqlMySQLConference
 
MySQL Idiosyncrasies That Bite 2010.07
MySQL Idiosyncrasies That Bite 2010.07MySQL Idiosyncrasies That Bite 2010.07
MySQL Idiosyncrasies That Bite 2010.07Ronald Bradford
 

Similar to MySQL5.7で遊んでみよう (20)

Hanya contoh saja dari xampp
Hanya contoh saja dari xamppHanya contoh saja dari xampp
Hanya contoh saja dari xampp
 
MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
 
Mysql56 replication
Mysql56 replicationMysql56 replication
Mysql56 replication
 
MySQL SQL Tutorial
MySQL SQL TutorialMySQL SQL Tutorial
MySQL SQL Tutorial
 
MySQLinsanity
MySQLinsanityMySQLinsanity
MySQLinsanity
 
16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboards16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboards
 
MySQL 5.7 innodb_enhance_partii_20160527
MySQL 5.7 innodb_enhance_partii_20160527MySQL 5.7 innodb_enhance_partii_20160527
MySQL 5.7 innodb_enhance_partii_20160527
 
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
 
Tugas praktikum smbd
Tugas praktikum smbdTugas praktikum smbd
Tugas praktikum smbd
 
OSMC 2008 | Monitoring MySQL by Geert Vanderkelen
OSMC 2008 | Monitoring MySQL by Geert VanderkelenOSMC 2008 | Monitoring MySQL by Geert Vanderkelen
OSMC 2008 | Monitoring MySQL by Geert Vanderkelen
 
Instalar MySQL CentOS
Instalar MySQL CentOSInstalar MySQL CentOS
Instalar MySQL CentOS
 
Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL Troubleshooting
 
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
 Design and Develop SQL DDL statements which demonstrate the use of SQL objec... Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
 
Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL Troubleshooting
 
MySQL Idiosyncrasies That Bite SF
MySQL Idiosyncrasies That Bite SFMySQL Idiosyncrasies That Bite SF
MySQL Idiosyncrasies That Bite SF
 
MySQL Kitchen : spice up your everyday SQL queries
MySQL Kitchen : spice up your everyday SQL queriesMySQL Kitchen : spice up your everyday SQL queries
MySQL Kitchen : spice up your everyday SQL queries
 
ProxySQL & PXC(Query routing and Failover Test)
ProxySQL & PXC(Query routing and Failover Test)ProxySQL & PXC(Query routing and Failover Test)
ProxySQL & PXC(Query routing and Failover Test)
 
Memcached Functions For My Sql Seemless Caching In My Sql
Memcached Functions For My Sql Seemless Caching In My SqlMemcached Functions For My Sql Seemless Caching In My Sql
Memcached Functions For My Sql Seemless Caching In My Sql
 
Mysql basics1
Mysql basics1Mysql basics1
Mysql basics1
 
MySQL Idiosyncrasies That Bite 2010.07
MySQL Idiosyncrasies That Bite 2010.07MySQL Idiosyncrasies That Bite 2010.07
MySQL Idiosyncrasies That Bite 2010.07
 

More from yoku0825

逝くぞ最新版、罠の貯蔵は十分か
逝くぞ最新版、罠の貯蔵は十分か逝くぞ最新版、罠の貯蔵は十分か
逝くぞ最新版、罠の貯蔵は十分かyoku0825
 
サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技
サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技
サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技yoku0825
 
MySQLレプリケーションあれやこれや
MySQLレプリケーションあれやこれやMySQLレプリケーションあれやこれや
MySQLレプリケーションあれやこれやyoku0825
 
MySQL 8.0で憶えておいてほしいこと
MySQL 8.0で憶えておいてほしいことMySQL 8.0で憶えておいてほしいこと
MySQL 8.0で憶えておいてほしいことyoku0825
 
片手間MySQLチューニング戦略
片手間MySQLチューニング戦略片手間MySQLチューニング戦略
片手間MySQLチューニング戦略yoku0825
 
MySQLを割と一人で300台管理する技術
MySQLを割と一人で300台管理する技術MySQLを割と一人で300台管理する技術
MySQLを割と一人で300台管理する技術yoku0825
 
MySQLステータスモニタリング
MySQLステータスモニタリングMySQLステータスモニタリング
MySQLステータスモニタリングyoku0825
 
わかった気になるMySQL
わかった気になるMySQLわかった気になるMySQL
わかった気になるMySQLyoku0825
 
わたしを支える技術
わたしを支える技術わたしを支える技術
わたしを支える技術yoku0825
 
MySQL 5.7の次のMySQL 8.0はどんなものになるだろう
MySQL 5.7の次のMySQL 8.0はどんなものになるだろうMySQL 5.7の次のMySQL 8.0はどんなものになるだろう
MySQL 5.7の次のMySQL 8.0はどんなものになるだろうyoku0825
 
Dockerイメージで誰でも気軽にMroonga体験
Dockerイメージで誰でも気軽にMroonga体験Dockerイメージで誰でも気軽にMroonga体験
Dockerイメージで誰でも気軽にMroonga体験yoku0825
 
MySQLアンチパターン
MySQLアンチパターンMySQLアンチパターン
MySQLアンチパターンyoku0825
 
MySQLerの7つ道具 plus
MySQLerの7つ道具 plusMySQLerの7つ道具 plus
MySQLerの7つ道具 plusyoku0825
 
MySQL 5.7の次のMySQLは
MySQL 5.7の次のMySQLはMySQL 5.7の次のMySQLは
MySQL 5.7の次のMySQLはyoku0825
 
MySQLerの7つ道具
MySQLerの7つ道具MySQLerの7つ道具
MySQLerの7つ道具yoku0825
 
MHAの次を目指す mikasafabric for MySQL
MHAの次を目指す mikasafabric for MySQLMHAの次を目指す mikasafabric for MySQL
MHAの次を目指す mikasafabric for MySQLyoku0825
 
5.7の次のMySQL
5.7の次のMySQL5.7の次のMySQL
5.7の次のMySQLyoku0825
 
mikasafabric for MySQL
mikasafabric for MySQLmikasafabric for MySQL
mikasafabric for MySQLyoku0825
 
MySQL Fabricでぼっこぼこにされたはなし
MySQL FabricでぼっこぼこにされたはなしMySQL Fabricでぼっこぼこにされたはなし
MySQL Fabricでぼっこぼこにされたはなしyoku0825
 
MySQLと正規形のはなし
MySQLと正規形のはなしMySQLと正規形のはなし
MySQLと正規形のはなしyoku0825
 

More from yoku0825 (20)

逝くぞ最新版、罠の貯蔵は十分か
逝くぞ最新版、罠の貯蔵は十分か逝くぞ最新版、罠の貯蔵は十分か
逝くぞ最新版、罠の貯蔵は十分か
 
サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技
サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技
サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技
 
MySQLレプリケーションあれやこれや
MySQLレプリケーションあれやこれやMySQLレプリケーションあれやこれや
MySQLレプリケーションあれやこれや
 
MySQL 8.0で憶えておいてほしいこと
MySQL 8.0で憶えておいてほしいことMySQL 8.0で憶えておいてほしいこと
MySQL 8.0で憶えておいてほしいこと
 
片手間MySQLチューニング戦略
片手間MySQLチューニング戦略片手間MySQLチューニング戦略
片手間MySQLチューニング戦略
 
MySQLを割と一人で300台管理する技術
MySQLを割と一人で300台管理する技術MySQLを割と一人で300台管理する技術
MySQLを割と一人で300台管理する技術
 
MySQLステータスモニタリング
MySQLステータスモニタリングMySQLステータスモニタリング
MySQLステータスモニタリング
 
わかった気になるMySQL
わかった気になるMySQLわかった気になるMySQL
わかった気になるMySQL
 
わたしを支える技術
わたしを支える技術わたしを支える技術
わたしを支える技術
 
MySQL 5.7の次のMySQL 8.0はどんなものになるだろう
MySQL 5.7の次のMySQL 8.0はどんなものになるだろうMySQL 5.7の次のMySQL 8.0はどんなものになるだろう
MySQL 5.7の次のMySQL 8.0はどんなものになるだろう
 
Dockerイメージで誰でも気軽にMroonga体験
Dockerイメージで誰でも気軽にMroonga体験Dockerイメージで誰でも気軽にMroonga体験
Dockerイメージで誰でも気軽にMroonga体験
 
MySQLアンチパターン
MySQLアンチパターンMySQLアンチパターン
MySQLアンチパターン
 
MySQLerの7つ道具 plus
MySQLerの7つ道具 plusMySQLerの7つ道具 plus
MySQLerの7つ道具 plus
 
MySQL 5.7の次のMySQLは
MySQL 5.7の次のMySQLはMySQL 5.7の次のMySQLは
MySQL 5.7の次のMySQLは
 
MySQLerの7つ道具
MySQLerの7つ道具MySQLerの7つ道具
MySQLerの7つ道具
 
MHAの次を目指す mikasafabric for MySQL
MHAの次を目指す mikasafabric for MySQLMHAの次を目指す mikasafabric for MySQL
MHAの次を目指す mikasafabric for MySQL
 
5.7の次のMySQL
5.7の次のMySQL5.7の次のMySQL
5.7の次のMySQL
 
mikasafabric for MySQL
mikasafabric for MySQLmikasafabric for MySQL
mikasafabric for MySQL
 
MySQL Fabricでぼっこぼこにされたはなし
MySQL FabricでぼっこぼこにされたはなしMySQL Fabricでぼっこぼこにされたはなし
MySQL Fabricでぼっこぼこにされたはなし
 
MySQLと正規形のはなし
MySQLと正規形のはなしMySQLと正規形のはなし
MySQLと正規形のはなし
 

Recently uploaded

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Recently uploaded (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

MySQL5.7で遊んでみよう