SlideShare uma empresa Scribd logo
1 de 20
Baixar para ler offline
1
MySQLの限界に挑戦する(?!)
MySQL Casual Talks vol.10
2017-02-01 19:10 LT
@meijik
免責事項
• 本プレゼンテーションにおいて示されている
見解は、私自身の見解であって、私の所属す
る会社・団体の見解を必ずしも反映したもの
ではありません。ご了承ください。
2
3
MySQLの限界
• よいこのみんなはこれを見てるよね!
• 限界までMySQLを使い尽くす!!(漢のコンピュータ道)
– http://nippondanji.blogspot.jp/2009/05/mysql.html
• 今回のLTはそれを順に見ていこうとしました
が、結果は。。。。
4
SQL文の最大長
• 限界までMySQLを使い尽くす!!(漢のコン
ピュータ道)によると。。。。
– MySQLサーバーが実行出来るSQL文の最大長
は、max_allowed_packetシステム変数で表され
る。max_allowed_packetの最大値は1GBであ
る。max_allowed_packetの値はセッションごとに
も設定可能なので、デフォルトではそこそこの値
(16MBなど)に設定しておいて、必要に応じて大
きな対を使うと良いだろう。
– デフォルト値は5.6より前は1MB, 5.6以降4MB
5
無意味なクエリでトライ!
UNION ALLで一連の値を返すクエリを作成。
↓こんな感じ
select repeat(' union all select "b"',4000) into
@a;
set @a= concat('select "a" ', @a);
prepare stmt1 from @a;
execute stmt1;
deallocate prepare stmt1;
6
できたクエリ
• select "a" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union allselect "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
7
できたクエリ(一部拡大)
• select "a" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union allselect "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select
"b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all
select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union
all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
select “a” union all select “b” union all select “b” …
8
さて実行!
mysql> select repeat(' union all select "b"',4000)
into @a;
Query OK, 1 row affected (0.00 sec)
mysql> set @a= concat('select "a" ', @a);
Query OK, 0 rows affected (0.00 sec)
mysql> prepare stmt1 from @a;
ERROR 1436 (HY000): Thread stack overrun:
246184 bytes used of a 262144 byte stack, and
16000 bytes needed. Use 'mysqld --
thread_stack=#' to specify a bigger stack.
9
スタック不足
• thread_stack
– https://dev.mysql.com/doc/refman/5.6/ja/serve
r-system-variables.html#sysvar_thread_stack
• 各スレッドのスタックサイズ。デフォルトの
256KBは、通常の操作では十分な大きさです。
スレッドスタックサイズが小さすぎるとサーバ
で処理できる SQL ステートメントの複雑さ、
ストアドプロシージャーの再帰の深さなど、メ
モリーを大量に消費する処理が制限されます。
10
じゃ2倍の512KBで
• 成功!
• じゃreapeatも二倍の8000で!
mysql> prepare stmt1 from @a;
ERROR 1064 (42000): memory exhausted
near '"b" union all select "b"' at line 1
→失敗orz
11
ERROR 1064 (42000)
• 通常クエリが文法的に間違っているときによ
くでる。
• perror 1064
– MySQL error code 1064
(ER_PARSE_ERROR): %s near ‘%-.80s’ at
line %d
• ただ今回は文法的にはあっている(はず)で
キーワード(%s) が “memory exhausted “
12
ソースをfindstr
(windowsのgrepライクなコマンド)
• mysql-5.7.17¥sql>findstr /nsi
/c:"memory exhausted" *
• sql_hints.yy.cc:1362: yyoverflow (YY_("memory
exhausted"),
• sql_hints.yy.cc:2099: yyerror (thd, scanner, ret,
YY_("memory exhausted"));
• sql_yacc.cc:19899: yyoverflow (YY_("memory
exhausted"),
• sql_yacc.cc:41019: yyerror (&yylloc, YYTHD,
YY_("memory exhausted"));
13
構文解析と字句解析
• クエリの解析
– 字句解析
– 構文解析
• 構文的には正しい(無意味な)複雑なクエリを
構文解析していて、内部的に用意しておいた
メモリを使い果たしたらしい。。。
• 通常のプログラムでは構文解析にyacc, 字句
解析にlexを利用する。
– 拡張子.yyはyaccのソースファイル
14
bisonとflex
• クエリの解析
– 字句解析: lex -> GNU版がflex
– 構文解析: yacc -> GNU版がbison
15
MySQLの場合
• クエリの解析
– 字句解析: 自前で行っている
– 構文解析: BNFで記述したソースをGNU bisonに
てコンパイルして行っている。
• BNF(バッカス・ナウア記法)
• バッカス・ナウア記法(英: Backus-Naur
form)とは、文脈自由文法を定義するのに用
いられるメタ言語のことで、一般にBNFやBN
記法と略される。(wikipediaより引用)
16
SQL標準をBNFで
• 初期のSQLは書籍などでBNF(バッカス・ナウ
ア記法)の記述があった。
• 現在奇特な方がSQL-92, 99, 2003のBNFを
公開してなさる。(多分読みきれん)
– https://github.com/ronsavage/SQL
• これを使えば多分クエリの整形ツールをつ
くったり(多分できる)、RDBMSを作ったりする
ことができると思われます。(多分無理)
17
まとめ
• MySQLのクエリの最大長(max_allowed_packet)
• スタックに引っかかる場合→スタックサイズを
大きくして対応
• 構文解析でメモリを使い果たした場合→簡単
な対応なし(まぁほとんど起こらない)
• MySQLのビルドになぜbisonが必要なのか、
と@kumagiのツイートの意味が分かった。
宣伝: 書籍情報
• おうちで学べるデータベースのきほん
– DBの初心者はこちらをどうぞ。
– なぜか韓国語版が発売
• 入手方法
– じゃんけんで勝つ。
– もしくは、Amazonでポチる w。
18
19
THANK YOU
• ご清聴ありがとうございました。
• [fyi] yacc/lexの参考書籍
– 日本語
• lex&yaccプログラミング (オライリージャパン)
• Cコンパイラ設計―yacc/lexの応用
• yacc/lex―プログラムジェネレータon UNIX
– 英語
• flex&bison (O‘reilly)
– 比較的新しい(2009/08)本(@meijikは未見)
– SQLの例がある(らしい)
20
MySQLの限界にチョット挑戦した。
MySQL Casual Talks vol.10
2017-02-01 LT
@meijik

Mais conteúdo relacionado

Mais procurados

「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜
「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜
「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜
Takahiro Inoue
 
文字コードに起因する脆弱性とその対策(増補版)
文字コードに起因する脆弱性とその対策(増補版)文字コードに起因する脆弱性とその対策(増補版)
文字コードに起因する脆弱性とその対策(増補版)
Hiroshi Tokumaru
 

Mais procurados (20)

SQL大量発行処理をいかにして高速化するか
SQL大量発行処理をいかにして高速化するかSQL大量発行処理をいかにして高速化するか
SQL大量発行処理をいかにして高速化するか
 
Vacuum徹底解説
Vacuum徹底解説Vacuum徹底解説
Vacuum徹底解説
 
pg_hint_planを知る(第37回PostgreSQLアンカンファレンス@オンライン 発表資料)
pg_hint_planを知る(第37回PostgreSQLアンカンファレンス@オンライン 発表資料)pg_hint_planを知る(第37回PostgreSQLアンカンファレンス@オンライン 発表資料)
pg_hint_planを知る(第37回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
WiredTigerを詳しく説明
WiredTigerを詳しく説明WiredTigerを詳しく説明
WiredTigerを詳しく説明
 
「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜
「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜
「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜
 
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
Linux女子部 systemd徹底入門
Linux女子部 systemd徹底入門Linux女子部 systemd徹底入門
Linux女子部 systemd徹底入門
 
MySQLレプリケーションあれやこれや
MySQLレプリケーションあれやこれやMySQLレプリケーションあれやこれや
MySQLレプリケーションあれやこれや
 
MySQL5.7 GA の Multi-threaded slave
MySQL5.7 GA の Multi-threaded slaveMySQL5.7 GA の Multi-threaded slave
MySQL5.7 GA の Multi-threaded slave
 
やってはいけない空振りDelete
やってはいけない空振りDeleteやってはいけない空振りDelete
やってはいけない空振りDelete
 
MySQL 5.7 トラブルシューティング 性能解析入門編
MySQL 5.7 トラブルシューティング 性能解析入門編MySQL 5.7 トラブルシューティング 性能解析入門編
MySQL 5.7 トラブルシューティング 性能解析入門編
 
文字コードに起因する脆弱性とその対策(増補版)
文字コードに起因する脆弱性とその対策(増補版)文字コードに起因する脆弱性とその対策(増補版)
文字コードに起因する脆弱性とその対策(増補版)
 
PostreSQL監査
PostreSQL監査PostreSQL監査
PostreSQL監査
 
アーキテクチャから理解するPostgreSQLのレプリケーション
アーキテクチャから理解するPostgreSQLのレプリケーションアーキテクチャから理解するPostgreSQLのレプリケーション
アーキテクチャから理解するPostgreSQLのレプリケーション
 
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
 
なかったらINSERTしたいし、あるならロック取りたいやん?
なかったらINSERTしたいし、あるならロック取りたいやん?なかったらINSERTしたいし、あるならロック取りたいやん?
なかったらINSERTしたいし、あるならロック取りたいやん?
 
AWSとオンプレミスを繋ぐときに知っておきたいルーティングの基礎知識(CCSI監修!)
AWSとオンプレミスを繋ぐときに知っておきたいルーティングの基礎知識(CCSI監修!)AWSとオンプレミスを繋ぐときに知っておきたいルーティングの基礎知識(CCSI監修!)
AWSとオンプレミスを繋ぐときに知っておきたいルーティングの基礎知識(CCSI監修!)
 
スケールアウトするPostgreSQLを目指して!その第一歩!(NTTデータ テクノロジーカンファレンス 2020 発表資料)
スケールアウトするPostgreSQLを目指して!その第一歩!(NTTデータ テクノロジーカンファレンス 2020 発表資料)スケールアウトするPostgreSQLを目指して!その第一歩!(NTTデータ テクノロジーカンファレンス 2020 発表資料)
スケールアウトするPostgreSQLを目指して!その第一歩!(NTTデータ テクノロジーカンファレンス 2020 発表資料)
 
グラフ構造のデータモデルをPower BIで可視化してみた
グラフ構造のデータモデルをPower BIで可視化してみたグラフ構造のデータモデルをPower BIで可視化してみた
グラフ構造のデータモデルをPower BIで可視化してみた
 
MongoDBが遅いときの切り分け方法
MongoDBが遅いときの切り分け方法MongoDBが遅いときの切り分け方法
MongoDBが遅いときの切り分け方法
 

Destaque

Gunosy go2015 06-02
Gunosy go2015 06-02Gunosy go2015 06-02
Gunosy go2015 06-02
Yuta Kashino
 
Reflectionのパフォーマンス
ReflectionのパフォーマンスReflectionのパフォーマンス
Reflectionのパフォーマンス
明 高橋
 

Destaque (13)

[Golang] Go言語でサービス作ってる話
[Golang] Go言語でサービス作ってる話[Golang] Go言語でサービス作ってる話
[Golang] Go言語でサービス作ってる話
 
20130824 Lightweight Language "Go" @LL matsuri
20130824 Lightweight Language "Go" @LL matsuri20130824 Lightweight Language "Go" @LL matsuri
20130824 Lightweight Language "Go" @LL matsuri
 
Gunosy go2015 06-02
Gunosy go2015 06-02Gunosy go2015 06-02
Gunosy go2015 06-02
 
Go言語によるwebアプリの作り方
Go言語によるwebアプリの作り方Go言語によるwebアプリの作り方
Go言語によるwebアプリの作り方
 
Chef localmodeをためした
Chef localmodeをためしたChef localmodeをためした
Chef localmodeをためした
 
SQL 脳から見た Ruby
SQL 脳から見た RubySQL 脳から見た Ruby
SQL 脳から見た Ruby
 
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はどんなものになるだろう
 
Reflectionのパフォーマンス
ReflectionのパフォーマンスReflectionのパフォーマンス
Reflectionのパフォーマンス
 
ペパボ de MySQL
ペパボ de MySQLペパボ de MySQL
ペパボ de MySQL
 
MySQL 5.7の次のMySQLは
MySQL 5.7の次のMySQLはMySQL 5.7の次のMySQLは
MySQL 5.7の次のMySQLは
 
MySQLerの7つ道具 plus
MySQLerの7つ道具 plusMySQLerの7つ道具 plus
MySQLerの7つ道具 plus
 
MySQL 8.0で憶えておいてほしいこと
MySQL 8.0で憶えておいてほしいことMySQL 8.0で憶えておいてほしいこと
MySQL 8.0で憶えておいてほしいこと
 

Mais de Meiji Kimura (6)

My sql casual12lt
My sql casual12ltMy sql casual12lt
My sql casual12lt
 
オープンソースRDBMS新機能ランダウンOSC2017TokyoSpring
オープンソースRDBMS新機能ランダウンOSC2017TokyoSpringオープンソースRDBMS新機能ランダウンOSC2017TokyoSpring
オープンソースRDBMS新機能ランダウンOSC2017TokyoSpring
 
オープンソース・データベースの最新事情
オープンソース・データベースの最新事情オープンソース・データベースの最新事情
オープンソース・データベースの最新事情
 
My sql casual9lt_pub
My sql casual9lt_pubMy sql casual9lt_pub
My sql casual9lt_pub
 
NULLとの戦い RDBMS実装編
NULLとの戦い RDBMS実装編NULLとの戦い RDBMS実装編
NULLとの戦い RDBMS実装編
 
MySQLインストールのお作法
MySQLインストールのお作法MySQLインストールのお作法
MySQLインストールのお作法
 

Último

Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Klinik kandungan
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
gajnagarg
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
Health
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Bertram Ludäscher
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
gajnagarg
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
nirzagarg
 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdf
SayantanBiswas37
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
vexqp
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
gajnagarg
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 

Último (20)

Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
 
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
 
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
 
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdf
 
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
 
Kings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themKings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about them
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 

MySQLの限界に挑戦する

  • 1. 1 MySQLの限界に挑戦する(?!) MySQL Casual Talks vol.10 2017-02-01 19:10 LT @meijik
  • 3. 3 MySQLの限界 • よいこのみんなはこれを見てるよね! • 限界までMySQLを使い尽くす!!(漢のコンピュータ道) – http://nippondanji.blogspot.jp/2009/05/mysql.html • 今回のLTはそれを順に見ていこうとしました が、結果は。。。。
  • 5. 5 無意味なクエリでトライ! UNION ALLで一連の値を返すクエリを作成。 ↓こんな感じ select repeat(' union all select "b"',4000) into @a; set @a= concat('select "a" ', @a); prepare stmt1 from @a; execute stmt1; deallocate prepare stmt1;
  • 6. 6 できたクエリ • select "a" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union allselect "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b"
  • 7. 7 できたクエリ(一部拡大) • select "a" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union allselect "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" union all select "b" select “a” union all select “b” union all select “b” …
  • 8. 8 さて実行! mysql> select repeat(' union all select "b"',4000) into @a; Query OK, 1 row affected (0.00 sec) mysql> set @a= concat('select "a" ', @a); Query OK, 0 rows affected (0.00 sec) mysql> prepare stmt1 from @a; ERROR 1436 (HY000): Thread stack overrun: 246184 bytes used of a 262144 byte stack, and 16000 bytes needed. Use 'mysqld -- thread_stack=#' to specify a bigger stack.
  • 9. 9 スタック不足 • thread_stack – https://dev.mysql.com/doc/refman/5.6/ja/serve r-system-variables.html#sysvar_thread_stack • 各スレッドのスタックサイズ。デフォルトの 256KBは、通常の操作では十分な大きさです。 スレッドスタックサイズが小さすぎるとサーバ で処理できる SQL ステートメントの複雑さ、 ストアドプロシージャーの再帰の深さなど、メ モリーを大量に消費する処理が制限されます。
  • 10. 10 じゃ2倍の512KBで • 成功! • じゃreapeatも二倍の8000で! mysql> prepare stmt1 from @a; ERROR 1064 (42000): memory exhausted near '"b" union all select "b"' at line 1 →失敗orz
  • 11. 11 ERROR 1064 (42000) • 通常クエリが文法的に間違っているときによ くでる。 • perror 1064 – MySQL error code 1064 (ER_PARSE_ERROR): %s near ‘%-.80s’ at line %d • ただ今回は文法的にはあっている(はず)で キーワード(%s) が “memory exhausted “
  • 12. 12 ソースをfindstr (windowsのgrepライクなコマンド) • mysql-5.7.17¥sql>findstr /nsi /c:"memory exhausted" * • sql_hints.yy.cc:1362: yyoverflow (YY_("memory exhausted"), • sql_hints.yy.cc:2099: yyerror (thd, scanner, ret, YY_("memory exhausted")); • sql_yacc.cc:19899: yyoverflow (YY_("memory exhausted"), • sql_yacc.cc:41019: yyerror (&yylloc, YYTHD, YY_("memory exhausted"));
  • 13. 13 構文解析と字句解析 • クエリの解析 – 字句解析 – 構文解析 • 構文的には正しい(無意味な)複雑なクエリを 構文解析していて、内部的に用意しておいた メモリを使い果たしたらしい。。。 • 通常のプログラムでは構文解析にyacc, 字句 解析にlexを利用する。 – 拡張子.yyはyaccのソースファイル
  • 14. 14 bisonとflex • クエリの解析 – 字句解析: lex -> GNU版がflex – 構文解析: yacc -> GNU版がbison
  • 15. 15 MySQLの場合 • クエリの解析 – 字句解析: 自前で行っている – 構文解析: BNFで記述したソースをGNU bisonに てコンパイルして行っている。 • BNF(バッカス・ナウア記法) • バッカス・ナウア記法(英: Backus-Naur form)とは、文脈自由文法を定義するのに用 いられるメタ言語のことで、一般にBNFやBN 記法と略される。(wikipediaより引用)
  • 16. 16 SQL標準をBNFで • 初期のSQLは書籍などでBNF(バッカス・ナウ ア記法)の記述があった。 • 現在奇特な方がSQL-92, 99, 2003のBNFを 公開してなさる。(多分読みきれん) – https://github.com/ronsavage/SQL • これを使えば多分クエリの整形ツールをつ くったり(多分できる)、RDBMSを作ったりする ことができると思われます。(多分無理)
  • 17. 17 まとめ • MySQLのクエリの最大長(max_allowed_packet) • スタックに引っかかる場合→スタックサイズを 大きくして対応 • 構文解析でメモリを使い果たした場合→簡単 な対応なし(まぁほとんど起こらない) • MySQLのビルドになぜbisonが必要なのか、 と@kumagiのツイートの意味が分かった。
  • 18. 宣伝: 書籍情報 • おうちで学べるデータベースのきほん – DBの初心者はこちらをどうぞ。 – なぜか韓国語版が発売 • 入手方法 – じゃんけんで勝つ。 – もしくは、Amazonでポチる w。 18
  • 19. 19 THANK YOU • ご清聴ありがとうございました。 • [fyi] yacc/lexの参考書籍 – 日本語 • lex&yaccプログラミング (オライリージャパン) • Cコンパイラ設計―yacc/lexの応用 • yacc/lex―プログラムジェネレータon UNIX – 英語 • flex&bison (O‘reilly) – 比較的新しい(2009/08)本(@meijikは未見) – SQLの例がある(らしい)