rabbit-slide-kou-oss-on-azure-5 2017.6.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 30fc24d0a066c538c7929fe3ddfb419bc8afadfe
4
+ data.tar.gz: 1396f6ff9949ed99eb87425d4f3b52144152cc75
5
+ SHA512:
6
+ metadata.gz: 1df3cae348e1850cb87e8d8b9d822a1234c10e6bc8666bec219b7476c2df302eb9f9c6e8c9d66bbded511ea02eddc638af8b3c6040038b920ebef58deebe44e9
7
+ data.tar.gz: 827f654db3d2e5342c0d26cd70cad5b634dfbe7b005dbdfd580817111736dc6df79821be5c1a2b7b8a1c44d5c72d54a54dd8caa90ca6f7fc0458f4cd66e599aa
data/.rabbit ADDED
@@ -0,0 +1 @@
1
+ mysql-and-postgresql-and-japanese-full-text-search.rab
@@ -0,0 +1,46 @@
1
+ = MySQLとPostgreSQLと日本語全文検索 - Azure DatabaseでMroonga・PGroongaを使いたいですよね!?
2
+
3
+ MySQL・PostgreSQLでの日本語全文検索の現状を紹介します。また、MySQL・PostgreSQLで日本語全文検索する方法としてMroonga・PGroongaを使う方法を紹介します。この話を聞くと、Azure DatabaseにMroonga・PGroongaがインストールされているといいのに!と思うはずです。
4
+
5
+ == ライセンス
6
+
7
+ === スライド
8
+
9
+ CC BY-SA 4.0
10
+
11
+ 原著作者名は以下の通りです。
12
+
13
+ * 須藤功平(またはKouhei Sutou)
14
+
15
+ === 画像
16
+
17
+ ==== Groonga・Mroonga・PGroongaのロゴ
18
+
19
+ CC BY 3.0
20
+
21
+ 原著作者名は以下の通りです。
22
+
23
+ * Groongaプロジェクト
24
+ * Mroongaプロジェクト
25
+ * PGroongaプロジェクト
26
+
27
+ == 作者向け
28
+
29
+ === 表示
30
+
31
+ rake
32
+
33
+ === 公開
34
+
35
+ rake publish
36
+
37
+ == 閲覧者向け
38
+
39
+ === インストール
40
+
41
+ gem install rabbit-slide-kou-oss-on-azure-5
42
+
43
+ === 表示
44
+
45
+ rabbit rabbit-slide-kou-oss-on-azure-5.gem
46
+
@@ -0,0 +1,17 @@
1
+ require "rabbit/task/slide"
2
+
3
+ # Edit ./config.yaml to customize meta data
4
+
5
+ spec = nil
6
+ Rabbit::Task::Slide.new do |task|
7
+ spec = task.spec
8
+ spec.files += Dir.glob("images/**/*.*")
9
+ # spec.files -= Dir.glob("private/**/*.*")
10
+ spec.add_runtime_dependency("rabbit-theme-groonga")
11
+ end
12
+
13
+ desc "Tag #{spec.version}"
14
+ task :tag do
15
+ sh("git", "tag", "-a", spec.version.to_s, "-m", "Publish #{spec.version}")
16
+ sh("git", "push", "--tags")
17
+ end
@@ -0,0 +1,28 @@
1
+ ---
2
+ id: oss-on-azure-5
3
+ base_name: mysql-and-postgresql-and-japanese-full-text-search
4
+ tags:
5
+ - rabbit
6
+ - mysql
7
+ - postgresql
8
+ - full-text-search
9
+ - mroonga
10
+ - pgroonga
11
+ - azure
12
+ presentation_date: 2017-06-26
13
+ version: 2017.6.26.0
14
+ licenses:
15
+ - CC BY 3.0
16
+ - CC BY-SA 4.0
17
+ slideshare_id: ossonazure5
18
+ speaker_deck_id:
19
+ ustream_id:
20
+ vimeo_id:
21
+ youtube_id:
22
+ author:
23
+ markup_language: :rd
24
+ name: Kouhei Sutou
25
+ email: kou@clear-code.com
26
+ rubygems_user: kou
27
+ slideshare_user: kou
28
+ speaker_deck_user:
@@ -0,0 +1,566 @@
1
+ = MySQLと\nPostgreSQLと\n日本語全文検索
2
+
3
+ : subtitle
4
+ Azure Databaseで\nMroonga・PGroongaを使いたいですよね!?
5
+ : author
6
+ 須藤功平
7
+ : institution
8
+ クリアコード
9
+ : content-source
10
+ OSS on Azure非公式コミュニティ #5 『Azure Database』勉強会
11
+ : date
12
+ 2017-06-26
13
+ : allotted-time
14
+ 15m
15
+ : theme
16
+ .
17
+
18
+ = アンケート
19
+
20
+ (('tag:center'))
21
+ (('tag:large'))
22
+ Azure Databaseで\n
23
+ 高速な日本語全文検索を\n
24
+ したい人!
25
+
26
+ (('tag:center'))
27
+ (('note:最後にもう一度似たようなことを聞くよ!'))
28
+
29
+ = 日本語全文検索:LIKE
30
+
31
+ (('tag:center'))
32
+ (('tag:x-large'))
33
+ LIKE
34
+
35
+ * 😄SQL標準
36
+ * MySQLでもPostgreSQLでも使える
37
+ * 😄少ないデータなら速度は十分
38
+ * 400文字×20万件くらいなら1秒とか
39
+
40
+ = LIKEのパフォーマンス
41
+
42
+ * 😣少なくないデータ
43
+ * レスポンスが遅い
44
+ * 😣多くの同時アクセス
45
+ * スループットがでない
46
+ * 1回のLIKE毎にCPUが専有されるため
47
+
48
+ = パフォーマンスの考え方
49
+
50
+ * 少ないデータ &&\n
51
+ 多くない同時アクセス
52
+ * LIKEで十分
53
+ * 少なくないデータ ||\n
54
+ 多くの同時アクセス
55
+ * 高速化が必要
56
+
57
+ = 高速日本語全文検索
58
+
59
+ (('tag:center'))
60
+ (('tag:margin-bottom'))
61
+ インデックスで高速化できる
62
+
63
+ * MySQL
64
+ * 5.7から標準対応
65
+ * PostgreSQL
66
+ * GIN(組込)+pg_trgm(標準添付)
67
+
68
+ = 高速?
69
+
70
+ (('tag:center'))
71
+ ベンチマーク!
72
+
73
+ * 対象:Wikipedia日本語版
74
+ * レコード数:約185万件
75
+ * データサイズ:約7GB
76
+ * メモリー4GB・SSD250GB(('note:(ConoHa)'))
77
+
78
+ (('note:https://github.com/groonga/wikipedia-search/issues/4'))
79
+
80
+ (('tag:center'))
81
+ (('note:(他人のベンチマークは参考程度)'))\n
82
+ (('note:(検討時はちゃんと実際の環境でベンチマークをとろう!)'))
83
+
84
+ = 注意
85
+
86
+ * pg_trgmではなくpg_bigmを使用
87
+ * pg_bigm:外部プラグイン
88
+ * 性能の傾向はだいたい同じ\n
89
+ (('note:1,2文字のときはpg_bigmの方が速い'))\n
90
+ (('note:3文字以上はpg_trgmの方が速い'))
91
+
92
+ = 検索1
93
+
94
+ (('tag:center'))
95
+ キーワード:テレビアニメ\n
96
+ (('note:(ヒット数:約2万3千件)'))
97
+
98
+ # RT
99
+ delimiter = [|]
100
+
101
+ InnoDB ngram | 3m2s
102
+ InnoDB MeCab | 6m20s
103
+ pg_bigm | 4s
104
+
105
+ = 検索2
106
+
107
+ (('tag:center'))
108
+ キーワード:データベース\n
109
+ (('note:(ヒット数:約1万7千件)'))
110
+
111
+ # RT
112
+ delimiter = [|]
113
+
114
+ InnoDB ngram | 36s
115
+ InnoDB MeCab | 0.03s
116
+ pg_bigm | 2s
117
+
118
+ = 検索3
119
+
120
+ (('tag:center'))
121
+ キーワード:PostgreSQL OR MySQL\n
122
+ (('note:(ヒット数:約400件)'))
123
+
124
+ # RT
125
+ delimiter = [|]
126
+
127
+ InnoDB ngram | N/A(エラー)
128
+ InnoDB MeCab | 0.005s
129
+ pg_bigm | 0.185s
130
+
131
+ = 検索4
132
+
133
+ (('tag:center'))
134
+ キーワード:日本\n
135
+ (('note:(ヒット数:約63万件)'))
136
+
137
+ # RT
138
+ delimiter = [|]
139
+
140
+ InnoDB ngram | 1.3s
141
+ InnoDB MeCab | 1.3s
142
+ pg_bigm | 0.84s
143
+
144
+ = 高速…?
145
+
146
+ * InnoDB FTS MeCab
147
+ * ハマれば速い
148
+ * クエリーが複数語だと遅い
149
+ * pg_bigm
150
+ * ハマれば速い
151
+ * ヒット数が多いと遅い
152
+ * (('note:InnoDB FTS ngram:安定して遅い'))
153
+
154
+ = Mroonga・PGroonga
155
+
156
+ * Mroonga(むるんが)
157
+ * (('wait'))MySQLに\n
158
+ 高速日本語全文検索機能を追加する\n
159
+ プロダクト
160
+ * PGroonga(ぴーじーるんが)
161
+ * (('wait'))PostgreSQLに\n
162
+ 高速日本語全文検索機能を追加する\n
163
+ プロダクト
164
+
165
+ = 検索1
166
+
167
+ (('tag:center'))
168
+ キーワード:テレビアニメ\n
169
+ (('note:(ヒット数:約2万3千件)'))
170
+
171
+ # RT
172
+ delimiter = [|]
173
+
174
+ InnoDB ngram | 3m2s
175
+ InnoDB MeCab | 6m20s
176
+ Mroonga:((*1*)) | 0.11s
177
+ pg_bigm | 4s
178
+ PGroonga:((*2*)) | 0.29s
179
+
180
+ = 検索2
181
+
182
+ (('tag:center'))
183
+ キーワード:データベース\n
184
+ (('note:(ヒット数:約1万7千件)'))
185
+
186
+ # RT
187
+ delimiter = [|]
188
+
189
+ InnoDB ngram | 36s
190
+ InnoDB MeCab:((*1*)) | 0.03s
191
+ Mroonga:((*2*)) | 0.09s
192
+ pg_bigm | 2s
193
+ PGroonga:((*3*)) | 0.17s
194
+
195
+ = 検索3
196
+
197
+ (('tag:center'))
198
+ キーワード:PostgreSQL OR MySQL\n
199
+ (('note:(ヒット数:約400件)'))
200
+
201
+ # RT
202
+ delimiter = [|]
203
+
204
+ InnoDB ngram | N/A(エラー)
205
+ InnoDB MeCab:((*1*)) | 0.005s
206
+ Mroonga:((*2*)) | 0.028s
207
+ pg_bigm | 0.185s
208
+ PGroonga:((*3*)) | 0.063s
209
+
210
+ = 検索4
211
+
212
+ (('tag:center'))
213
+ キーワード:日本\n
214
+ (('note:(ヒット数:約63万件)'))
215
+
216
+ # RT
217
+ delimiter = [|]
218
+
219
+ InnoDB ngram | 1.3s
220
+ InnoDB MeCab | 1.3s
221
+ Mroonga:((*1*)) | 0.21s
222
+ pg_bigm:((*2*)) | 0.84s
223
+ PGroonga | 1s
224
+
225
+ = 検索速度まとめ
226
+
227
+ * Mroonga・PGroonga
228
+ * 安定して速い
229
+ * InnoDB FTS MeCab・pg_bigm
230
+ * ハマれば速い
231
+ * InnoDB FTS ngram
232
+ * 安定して遅い
233
+
234
+ = Mroonga(むるんが)
235
+
236
+ MySQLに\n
237
+ 高速日本語\n
238
+ 全文検索機能を\n
239
+ 追加
240
+
241
+ == スライドプロパティ
242
+
243
+ : groonga-product
244
+
245
+ mroonga
246
+
247
+ = Mroonga:インデックス作成
248
+
249
+ (('tag:center'))
250
+ 普通のMySQLの使い方
251
+
252
+ # coderay sql
253
+ CREATE TABLE ... (
254
+ ...,
255
+ FULLTEXT INDEX (column)
256
+ ) ENGINE=Mroonga;
257
+
258
+ == スライドプロパティ
259
+
260
+ : groonga-product
261
+
262
+ mroonga
263
+
264
+ = Mroonga:全文検索
265
+
266
+ (('tag:center'))
267
+ 普通のMySQLの使い方
268
+
269
+ # coderay sql
270
+ SELECT * FROM ...
271
+ WHERE
272
+ MATCH(column)
273
+ AGAINST('キーワード'
274
+ IN BOOLEAN MODE);
275
+
276
+ == スライドプロパティ
277
+
278
+ : groonga-product
279
+
280
+ mroonga
281
+
282
+ = Mroonga:クエリー言語
283
+
284
+ (('tag:center'))
285
+ デフォルトOR→AND
286
+
287
+ # coderay sql
288
+ -- ↓AまたはBが含まれていればマッチ
289
+ AGAINST('A B' IN BOOLEAN MODE);
290
+ AGAINST('+A +B' IN BOOLEAN MODE);
291
+ -- ↑↓AとBが含まれていればマッチ
292
+ -- ↓Mroongaの拡張
293
+ AGAINST('*D+ A B' IN BOOLEAN MODE);
294
+
295
+ == スライドプロパティ
296
+
297
+ : groonga-product
298
+
299
+ mroonga
300
+
301
+ = Mroonga:Windows
302
+
303
+ (('tag:center'))
304
+ Windows用バイナリーあり
305
+
306
+ * MariaDBとセット
307
+ * ダウンロードして展開すると\n
308
+ すぐに使える
309
+
310
+ == スライドプロパティ
311
+
312
+ : groonga-product
313
+
314
+ mroonga
315
+
316
+ = PGroonga
317
+
318
+ PostgreSQLに\n
319
+ 高速日本語\n
320
+ 全文検索機能を\n
321
+ 追加
322
+
323
+ == スライドプロパティ
324
+
325
+ : groonga-product
326
+
327
+ pgroonga
328
+
329
+ = PGroonga:インデックス
330
+
331
+ (('tag:center'))
332
+ 普通のPostgreSQLの使い方
333
+
334
+ # coderay sql
335
+ CREATE INDEX name ON texts
336
+ USING pgroonga (content);
337
+
338
+ == スライドプロパティ
339
+
340
+ : groonga-product
341
+
342
+ pgroonga
343
+
344
+ = PGroonga:全文検索
345
+
346
+ (('tag:center'))
347
+ 専用演算子を使用
348
+
349
+ # coderay sql
350
+ SELECT * FROM ...
351
+ WHERE
352
+ column &? 'キーワード';
353
+
354
+ == スライドプロパティ
355
+
356
+ : groonga-product
357
+
358
+ pgroonga
359
+
360
+ = PGroonga:JSON
361
+
362
+ (('tag:center'))
363
+ JSON内の全テキストを全文検索
364
+
365
+ # coderay sql
366
+ CREATE TABLE logs (record jsonb);
367
+ CREATE INDEX i ON logs
368
+ USING pgroonga (record);
369
+ -- ログのどこかに「error」があればマッチ
370
+ SELECT * FROM logs
371
+ WHERE record &? 'error';
372
+
373
+ == スライドプロパティ
374
+
375
+ : groonga-product
376
+
377
+ pgroonga
378
+
379
+ = PGroonga:入力補完1
380
+
381
+ (('tag:center'))
382
+ 検索ボックスで便利なアレ
383
+
384
+ # coderay sql
385
+ CREATE TABLE terms
386
+ (term text, -- 候補単語
387
+ readings text[]); -- ヨミガナ
388
+ -- インデックス
389
+ CREATE INDEX i ON terms USING pgroonga
390
+ (term pgroonga.text_term_search_ops_v2,
391
+ readings pgroogna.text_array_term_search_ops_v2);
392
+
393
+ == スライドプロパティ
394
+
395
+ : groonga-product
396
+
397
+ pgroonga
398
+
399
+ = PGroonga:入力補完2
400
+
401
+ (('tag:center'))
402
+ 用意するデータ:\n
403
+ 候補とカタカナのヨミガナだけ
404
+
405
+ # coderay sql
406
+ INSERT INTO terms
407
+ VALUES
408
+ ('牛乳', -- 補完候補
409
+ ARRAY['ギュウニュウ', -- ヨミガナ1
410
+ 'ミルク']); -- ヨミガナ2
411
+
412
+ == スライドプロパティ
413
+
414
+ : groonga-product
415
+
416
+ pgroonga
417
+
418
+ = PGroonga:入力補完3
419
+
420
+ (('tag:center'))
421
+ ローマ字で検索
422
+
423
+ # coderay sql
424
+ SELECT term FROM terms
425
+ -- 「ギュウニュウ」にヒット
426
+ WHERE readings &^~ 'gy';
427
+ -- term
428
+ -- ------
429
+ -- 牛乳
430
+ -- (1 row)
431
+
432
+ == スライドプロパティ
433
+
434
+ : groonga-product
435
+
436
+ pgroonga
437
+
438
+ = PGroonga:入力補完4
439
+
440
+ (('tag:center'))
441
+ ひらがなで検索
442
+
443
+ # coderay sql
444
+ SELECT term FROM terms
445
+ -- 「ギュウニュウ」にヒット
446
+ WHERE readings &^~ 'ぎゅう';
447
+ -- term
448
+ -- ------
449
+ -- 牛乳
450
+ -- (1 row)
451
+
452
+ == スライドプロパティ
453
+
454
+ : groonga-product
455
+
456
+ pgroonga
457
+
458
+ = PGroonga:入力補完5
459
+
460
+ (('tag:center'))
461
+ カタカナで検索
462
+
463
+ # coderay sql
464
+ SELECT term FROM terms
465
+ -- 「ギュウニュウ」にヒット
466
+ WHERE readings &^~ 'ギュウ';
467
+ -- term
468
+ -- ------
469
+ -- 牛乳
470
+ -- (1 row)
471
+
472
+ == スライドプロパティ
473
+
474
+ : groonga-product
475
+
476
+ pgroonga
477
+
478
+ = PGroonga:入力補完6
479
+
480
+ (('tag:center'))
481
+ 別のヨミガナでもヒット
482
+
483
+ # coderay sql
484
+ SELECT term FROM terms
485
+ -- 「ミルク」にヒット
486
+ WHERE readings &^~ 'mi';
487
+ -- term
488
+ -- ------
489
+ -- 牛乳
490
+ -- (1 row)
491
+
492
+ == スライドプロパティ
493
+
494
+ : groonga-product
495
+
496
+ pgroonga
497
+
498
+ = PGroonga:入力補完7
499
+
500
+ (('tag:center'))
501
+ 漢字でもヒット
502
+
503
+ # coderay sql
504
+ SELECT term FROM terms
505
+ -- 「牛乳」にヒット
506
+ WHERE readings &^ '牛';
507
+ -- term
508
+ -- ------
509
+ -- 牛乳
510
+ -- (1 row)
511
+
512
+ == スライドプロパティ
513
+
514
+ : groonga-product
515
+
516
+ pgroonga
517
+
518
+ = PGroonga:Windows
519
+
520
+ (('tag:center'))
521
+ Windows用バイナリーあり
522
+
523
+ * 商用ログ管理製品\n
524
+ 「VVAULT AUDIT」が採用\n
525
+ (('note:http://vvault.jp/product/vvault-audit/'))
526
+ * アクセスログに対して\n
527
+ ユーザー名・パスを全文検索
528
+ * 決め手:高速・省スペース
529
+
530
+ == スライドプロパティ
531
+
532
+ : groonga-product
533
+
534
+ pgroonga
535
+
536
+ = まとめ
537
+
538
+ * Mroonga(むるんが)
539
+ * MySQLで高速日本語全文検索!
540
+ * しかも使いやすいし便利!
541
+ * PGroonga(ぴーじーるんが)
542
+ * PostgreSQLで高速日本語全文検索!
543
+ * しかも使いやすいし便利!
544
+
545
+ = アンケート1
546
+
547
+ (('tag:center'))
548
+ (('tag:large'))
549
+ Azure Databaseで\n
550
+ 高速な日本語全文検索を\n
551
+ したい人!
552
+
553
+ (('tag:center'))
554
+ (('note:最初より増えているといいな'))
555
+
556
+ = アンケート2
557
+
558
+ (('tag:center'))
559
+ (('tag:large'))
560
+ Azure Databaseで\n
561
+ Mroonga・PGroongaを\n
562
+ 使いたい人!
563
+
564
+ (('tag:center'))
565
+ (('note:Azure Database開発者にアピールして!'))\n
566
+ (('note:どういう風に使いたいか教えて!'))
@@ -0,0 +1,5 @@
1
+ @title_slide_title_font_size = @x_large_font_size
2
+ @title_slide_subtitle_font_size = @small_font_size
3
+ @title_slide_content_source_font_size = @xx_small_font_size
4
+
5
+ include_theme("groonga")
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rabbit-slide-kou-oss-on-azure-5
3
+ version: !ruby/object:Gem::Version
4
+ version: 2017.6.26.0
5
+ platform: ruby
6
+ authors:
7
+ - Kouhei Sutou
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-06-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rabbit
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 2.0.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: rabbit-theme-groonga
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: MySQL・PostgreSQLでの日本語全文検索の現状を紹介します。また、MySQL・PostgreSQLで日本語全文検索する方法としてMroonga・PGroongaを使う方法を紹介します。この話を聞くと、Azure
42
+ DatabaseにMroonga・PGroongaがインストールされているといいのに!と思うはずです。
43
+ email:
44
+ - kou@clear-code.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".rabbit"
50
+ - README.rd
51
+ - Rakefile
52
+ - config.yaml
53
+ - mysql-and-postgresql-and-japanese-full-text-search.rab
54
+ - pdf/oss-on-azure-5-mysql-and-postgresql-and-japanese-full-text-search.pdf
55
+ - theme.rb
56
+ homepage: http://slide.rabbit-shocker.org/authors/kou/oss-on-azure-5/
57
+ licenses:
58
+ - CC BY 3.0
59
+ - CC BY-SA 4.0
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 2.5.2
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: MySQLとPostgreSQLと日本語全文検索 - Azure DatabaseでMroonga・PGroongaを使いたいですよね!?
81
+ test_files: []