rabbit-slide-kou-pgconf-asia-2016 2016.12.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rabbit +1 -0
- data/PGroonga - Make PostgreSQL//nfast full text search platform//nfor all languages!.pdf +0 -0
- data/README.rd +46 -0
- data/Rakefile +60 -0
- data/config.yaml +24 -0
- data/data/index-creation-en.gnuplot +42 -0
- data/data/index-creation-en.tsv +2 -0
- data/data/search-en.gnuplot +45 -0
- data/data/search-en.tsv +5 -0
- data/data/search-ja.gnuplot +75 -0
- data/data/search-ja.tsv +5 -0
- data/data/style.gnuplot +29 -0
- data/images/gin-n-gram-index.svg +674 -0
- data/images/gin-n-gram-search.svg +807 -0
- data/images/index-creation-en.pdf +0 -0
- data/images/inverted-index.svg +800 -0
- data/images/performance-charcteristic-for-constant-read-and-write.svg +259 -0
- data/images/pgroonga-layer.svg +151 -0
- data/images/pgroonga-logo.svg +84 -0
- data/images/pgroonga-n-gram-search.svg +893 -0
- data/images/read-while-write-gin.svg +364 -0
- data/images/read-while-write-pgroonga.svg +325 -0
- data/images/replication-apply-action-logs.svg +3446 -0
- data/images/replication-overview.svg +1670 -0
- data/images/replication-write-action-logs.svg +3346 -0
- data/images/search-pg-bigm.pdf +0 -0
- data/images/search-pgroonga-groonga-textsearch.pdf +0 -0
- data/images/search-pgroonga-pg-bigm-all.pdf +0 -0
- data/images/search-pgroonga-pg-bigm.pdf +0 -0
- data/images/search-pgroonga-textsearch.pdf +0 -0
- data/pdf/pgconf-asia-2016-pgroonga.pdf +0 -0
- data/pgroonga.rab +614 -0
- data/theme.rb +3 -0
- metadata +109 -0
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/pgroonga.rab
ADDED
@@ -0,0 +1,614 @@
|
|
1
|
+
= PGroonga
|
2
|
+
|
3
|
+
: subtitle
|
4
|
+
Make PostgreSQL\nfast full text search platform\nfor all languages!
|
5
|
+
: author
|
6
|
+
Kouhei Sutou
|
7
|
+
: institution
|
8
|
+
ClearCode Inc.
|
9
|
+
: content-source
|
10
|
+
PGConf.ASIA 2016
|
11
|
+
: date
|
12
|
+
2016-12-03
|
13
|
+
: allotted-time
|
14
|
+
45m
|
15
|
+
: theme
|
16
|
+
.
|
17
|
+
|
18
|
+
= PostgreSQL and me\n(('note:PostgreSQLと私'))
|
19
|
+
|
20
|
+
Some my patches are merged\n
|
21
|
+
(('note:いくつかパッチがマージされている'))
|
22
|
+
|
23
|
+
= Patches\n(('note:パッチ'))
|
24
|
+
|
25
|
+
* (('wait'))BUG #13840: pg_dump generates unloadable SQL\n
|
26
|
+
(('note:pg_dumpがリストアできないSQLを出力する'))
|
27
|
+
* (('wait'))BUG #14160: DROP ACCESS METHOD IF EXISTS isn't impl.\n
|
28
|
+
(('note:DROP ACCESS METHOD IF EXISTSが実装されていない'))
|
29
|
+
|
30
|
+
(('wait'))
|
31
|
+
(('tag:center'))
|
32
|
+
They are found while developing PGroonga\n
|
33
|
+
(('note:どちらもPGroonga開発中に見つけた問題'))
|
34
|
+
|
35
|
+
= PGroonga dev style\n(('note:PGroongaの開発スタイル'))
|
36
|
+
|
37
|
+
* When there are problems in related projects including PostgreSQL\n
|
38
|
+
(('note:PostgreSQLを含む関連プロジェクトに問題があった場合'))
|
39
|
+
* (('wait'))We fix these problems in these projects
|
40
|
+
instead of choosing workaround in PGroonga\n
|
41
|
+
(('note:PGroonga側で回避するのではなく'))\n
|
42
|
+
(('note:関連プロジェクトの方で問題を直す'))
|
43
|
+
|
44
|
+
= PostgreSQL and FTS\n(('note:PostgreSQLと全文検索'))
|
45
|
+
|
46
|
+
* PostgreSQL has out-of-the-box full text search feature\n
|
47
|
+
(('note:PostgreSQLには組込の全文検索機能がある'))\n
|
48
|
+
* (('wait'))It has some problems...\n
|
49
|
+
(('note:ただ、いくつか問題がある'))
|
50
|
+
* (('wait'))We fixed them by PGroonga\n
|
51
|
+
(('note:PGroongaを開発することでそれらの問題を修正した'))
|
52
|
+
* (('wait'))instead of fixing PostgreSQL 😓\n
|
53
|
+
(('note:PostgreSQLを修正するのではなくて…'))
|
54
|
+
|
55
|
+
= Because...\n(('note:理由は…'))
|
56
|
+
|
57
|
+
(1) (('wait'))Our approach is different from PostgreSQL's approach\n
|
58
|
+
(('note:PGroongaのやり方はPostgreSQLのやり方と違う'))
|
59
|
+
(2) (('wait'))PG provides plugin system\n
|
60
|
+
(('note:PostgreSQLはプラグインの仕組みを提供している'))
|
61
|
+
* Implementing as a plugin is PostgreSQL way!\n
|
62
|
+
(('note:プラグインでの実装はPostgreSQLらしいやり方!'))
|
63
|
+
|
64
|
+
= PG FTS problem\n(('note:PostgreSQLの全文検索の問題'))
|
65
|
+
|
66
|
+
(('tag:center'))
|
67
|
+
(('tag:margin-bottom * 4'))
|
68
|
+
Many langs aren't supported\n
|
69
|
+
(('note:サポートしていない言語がたくさんある'))
|
70
|
+
|
71
|
+
* (('wait'))e.g.: Asian languages\n
|
72
|
+
(('note:例:アジアの言語'))
|
73
|
+
* Japanese, Chinese and more\n
|
74
|
+
(('note:日本語や中国語など'))
|
75
|
+
|
76
|
+
= FTS for Japanese1\n(('note:日本語の全文検索1'))
|
77
|
+
|
78
|
+
# coderay sql
|
79
|
+
SELECT
|
80
|
+
to_tsvector('japanese',
|
81
|
+
'こんにちは');
|
82
|
+
-- ERROR: text search configuration
|
83
|
+
-- "japanese" does not exist
|
84
|
+
-- LINE 2: to_tsvector('japanese',
|
85
|
+
-- ^
|
86
|
+
|
87
|
+
= FTS for Japanese2\n(('note:日本語の全文検索2'))
|
88
|
+
|
89
|
+
# coderay sql
|
90
|
+
CREATE EXTENSION pg_trgm;
|
91
|
+
SELECT 'こんにちは' % 'にちは';
|
92
|
+
-- ↑substring
|
93
|
+
-- ?column?
|
94
|
+
-- ----------
|
95
|
+
-- f ← Must be "t"!
|
96
|
+
-- (1 row)
|
97
|
+
|
98
|
+
= Existing solution\n(('note:既存の解決策'))
|
99
|
+
|
100
|
+
(('tag:center'))
|
101
|
+
pg_bigm
|
102
|
+
|
103
|
+
= pg_bigm
|
104
|
+
|
105
|
+
* An extension\n
|
106
|
+
(('note:拡張機能'))
|
107
|
+
* (('wait'))Similar to pg_trgm\n
|
108
|
+
(('note:pg_trgmと似ている'))
|
109
|
+
* Operator class for GIN\n
|
110
|
+
(('note:GIN用の演算子クラス'))
|
111
|
+
|
112
|
+
= pg_bigm: Usage\n(('note:pg_bigm:使い方'))
|
113
|
+
|
114
|
+
# coderay sql
|
115
|
+
CREATE INDEX index ON table
|
116
|
+
USING gin (column gin_bigm_ops);
|
117
|
+
-- ↑Use GIN ↑Specify op class
|
118
|
+
|
119
|
+
= pg_bigm: Demerit\n(('note:pg_bigm:デメリット'))
|
120
|
+
|
121
|
+
* Slow for large document\n
|
122
|
+
(('note:文書が長いと遅い'))\n
|
123
|
+
(('note:(Normally, we want to use FTS for large document)'))\n
|
124
|
+
(('note:(普通は長い文書に対して全文検索したい)'))
|
125
|
+
* (('wait'))Because it needs "recheck"\n
|
126
|
+
(('note:「recheck」が必要だから'))
|
127
|
+
|
128
|
+
= "recheck"
|
129
|
+
|
130
|
+
* "Exact" seq. search after\n
|
131
|
+
"loose" index search\n
|
132
|
+
(('note:「ゆるい」インデックス検索の後に実行する'))\n
|
133
|
+
(('note:「正確な」シーケンシャルサーチ'))
|
134
|
+
* (('wait'))The larger text, the slower\n
|
135
|
+
(('note:対象テキストが大きければ大きいほど遅くなる'))\n
|
136
|
+
* (('wait'))text = doc size * N docs\n
|
137
|
+
(('note:対象テキスト = 文書サイズ * 文書数'))
|
138
|
+
|
139
|
+
= Benchmark\n(('note:ベンチマーク'))
|
140
|
+
|
141
|
+
# image
|
142
|
+
# src = images/search-pg-bigm.pdf
|
143
|
+
# relative_height = 100
|
144
|
+
|
145
|
+
= New solution\n(('note:新しい解決策'))
|
146
|
+
|
147
|
+
# image
|
148
|
+
# src = images/pgroonga-logo.svg
|
149
|
+
# relative_width = 100
|
150
|
+
|
151
|
+
= PGroonga
|
152
|
+
|
153
|
+
* Pronunciation: píːzí:lúnɡά\n
|
154
|
+
(('note:読み方:ぴーじーるんが'))
|
155
|
+
|
156
|
+
* (('wait'))An extension\n
|
157
|
+
(('note:拡張機能'))
|
158
|
+
|
159
|
+
* (('wait'))Index and operator classes\n
|
160
|
+
(('note:インデックスと演算子クラス'))
|
161
|
+
* Not operator classes for GIN\n
|
162
|
+
(('note:GINの演算子クラスではない'))
|
163
|
+
|
164
|
+
= PGroonga layer
|
165
|
+
|
166
|
+
# image
|
167
|
+
# src = images/pgroonga-layer.svg
|
168
|
+
# relative_width = 100
|
169
|
+
|
170
|
+
= Benchmark\n(('note:ベンチマーク'))
|
171
|
+
|
172
|
+
# image
|
173
|
+
# src = images/search-pgroonga-pg-bigm.pdf
|
174
|
+
# relative_height = 100
|
175
|
+
|
176
|
+
= Wrap up1\n(('note:まとめ1'))
|
177
|
+
|
178
|
+
* PostgreSQL doesn't support Asian languages\n
|
179
|
+
(('note:PostgreSQLはアジアの言語をサポートしていない'))
|
180
|
+
|
181
|
+
* pg_bigm and PGroonga support all languages\n
|
182
|
+
(('note:pg_bigmとPGroongaはすべての言語をサポートしている'))
|
183
|
+
|
184
|
+
= Wrap up2\n(('note:まとめ2'))
|
185
|
+
|
186
|
+
* Many hits case:\n
|
187
|
+
(('note:ヒット数が多い場合'))
|
188
|
+
* pg_bigm is slow\n
|
189
|
+
(('note:pg_bigmは遅い'))
|
190
|
+
* PGroonga is fast\n
|
191
|
+
(('note:PGroongaは速い'))
|
192
|
+
|
193
|
+
= Why is PGroonga fast?\n(('note:PGroongaはどうして速いのか'))
|
194
|
+
|
195
|
+
* Doesn't need "recheck"\n
|
196
|
+
(('note:「recheck」が必要ないから'))
|
197
|
+
|
198
|
+
* (('wait'))Is "recheck" really slow?\n
|
199
|
+
(('note:本当に「recheck」が遅いの?'))
|
200
|
+
* See one more benchmark result\n
|
201
|
+
(('note:もう一つベンチマーク結果を見てみましょう'))
|
202
|
+
|
203
|
+
= Benchmark\n(('note:ベンチマーク'))
|
204
|
+
|
205
|
+
# image
|
206
|
+
# src = images/search-pgroonga-pg-bigm-all.pdf
|
207
|
+
# relative_height = 100
|
208
|
+
|
209
|
+
= Why is pg_bigm fast?\n(('note:pg_bigmはどうして速いのか'))
|
210
|
+
|
211
|
+
* Query is "日本"\n
|
212
|
+
(('note:クエリーは「日本」'))
|
213
|
+
* Point: 2 characters\n
|
214
|
+
(('note:ポイント:2文字'))
|
215
|
+
* (('wait'))pg_bigm doesn't need "recheck" for 2 chars query\n
|
216
|
+
(('note:pg_bigmは2文字のクエリーに「recheck」の必要がない'))
|
217
|
+
* It means that "recheck" is slow\n
|
218
|
+
(('note:つまり「recheck」が遅いということ'))
|
219
|
+
|
220
|
+
= N-gram and "recheck"\n(('note:N-gramと「recheck」'))
|
221
|
+
|
222
|
+
* N-gram approach needs "phrase search" when query has N or more characters\n
|
223
|
+
(('note:N+1文字以上のクエリーには「フレーズ検索」が必要'))
|
224
|
+
* N=2 for pg_bigm, N=3 for pg_trgm\n
|
225
|
+
(('note:pg_bigmはN=2でpg_trgmはN=3'))
|
226
|
+
|
227
|
+
* (('wait'))GIN needs "recheck" for "phrase search"\n
|
228
|
+
(('note:GINは「フレーズ検索」には「recheck」が必要'))
|
229
|
+
|
230
|
+
= Phrase search\n(('note:フレーズ検索'))
|
231
|
+
|
232
|
+
* Phrase search is "token search" and "position check"\n
|
233
|
+
(('note:フレーズ検索は「トークン検索」と「位置チェック」'))
|
234
|
+
* Tokens must exist and be ordered\n
|
235
|
+
(('note:トークンは同じ順序で出現していないといけない'))
|
236
|
+
* OK: "car at" for "car at" query
|
237
|
+
* NG: "at car" for "car at" query
|
238
|
+
|
239
|
+
= N-gram and phrase search
|
240
|
+
|
241
|
+
(1) Split text to tokens\n
|
242
|
+
(('note:テキストをトークンに分割'))
|
243
|
+
* "cat"→"ca","at"
|
244
|
+
(2) ((*Search all tokens*))\n
|
245
|
+
(('note:すべてのトークンを検索'))
|
246
|
+
* "ca" and "at" exist: Candidate!
|
247
|
+
(3) ((*Check appearance pos.*))\n
|
248
|
+
(('note:出現位置をチェック'))
|
249
|
+
* "ca" then "at": Found!
|
250
|
+
|
251
|
+
= N-gram and GIN: Create\n(('note:N-gramとGIN:作成'))
|
252
|
+
|
253
|
+
# image
|
254
|
+
# src = images/gin-n-gram-index.svg
|
255
|
+
# relative_height = 100
|
256
|
+
|
257
|
+
= N-gram and GIN: Search\n(('note:N-gramとGIN:検索'))
|
258
|
+
|
259
|
+
# image
|
260
|
+
# src = images/gin-n-gram-search.svg
|
261
|
+
# relative_height = 100
|
262
|
+
|
263
|
+
= GIN and phrase search\n(('note:GINとフレーズ検索'))
|
264
|
+
|
265
|
+
* Phrase search needs position check\n
|
266
|
+
(('note:フレーズ検索では出現位置チェックが必要'))
|
267
|
+
* GIN doesn't support position check\n
|
268
|
+
(('note:GINは出現位置チェックをサポートしていない'))
|
269
|
+
* →GIN needs "recheck"→Slow!\n
|
270
|
+
(('note:GINでは「recheck」が必要だから遅い'))
|
271
|
+
|
272
|
+
= Why is PGroonga fast?\n(('note:PGroongaはどうして速いのか'))
|
273
|
+
|
274
|
+
* PGroonga uses N-gram (('note:by default'))\n
|
275
|
+
(('note:PGroongaはデフォルトでN-gramを使っている'))
|
276
|
+
* But doesn't need "recheck"\n
|
277
|
+
(('note:PGroongaは「recheck」の必要がない'))
|
278
|
+
|
279
|
+
= Why no "recheck"?\n(('note:どうして「recheck」が必要ないのか'))
|
280
|
+
|
281
|
+
PGroonga uses\n
|
282
|
+
((*full*))\n
|
283
|
+
inverted index\n
|
284
|
+
(('note:PGroongaは((*完全*))転置インデックスを使っているから'))
|
285
|
+
|
286
|
+
= Full inverted index\n(('note:完全転置インデックス'))
|
287
|
+
|
288
|
+
Including position\n
|
289
|
+
(('note:位置情報を含む'))
|
290
|
+
|
291
|
+
= Inverted index diff\n(('note:転置インデックスの違い'))
|
292
|
+
|
293
|
+
# image
|
294
|
+
# src = images/inverted-index.svg
|
295
|
+
# relative_height = 100
|
296
|
+
|
297
|
+
= N-gram/PGroonga: Search\n(('note:N-gramとPGroonga:検索'))
|
298
|
+
|
299
|
+
# image
|
300
|
+
# src = images/pgroonga-n-gram-search.svg
|
301
|
+
# relative_height = 100
|
302
|
+
|
303
|
+
= Wrap up\n(('note:まとめ'))
|
304
|
+
|
305
|
+
* N-gram needs phrase search\n
|
306
|
+
(('note:N-gramの場合はフレーズ検索が必要'))
|
307
|
+
* Full inverted index provides fast phrase search\n
|
308
|
+
(('note:完全転置インデックスを使うと高速にフレーズ検索できる'))
|
309
|
+
* GIN isn't full inverted index\n
|
310
|
+
(('note:GINは完全転置インデックスではない'))
|
311
|
+
* PGroonga uses full inverted index\n
|
312
|
+
(('note:PGroongaは完全転置インデックスを使っている'))
|
313
|
+
|
314
|
+
= FTS and English(*)\n(('note:全文検索と英語'))
|
315
|
+
|
316
|
+
* Normally, N-gram isn't used for English FTS\n
|
317
|
+
(('note:普通は英語の全文検索にN-gramを使わない'))
|
318
|
+
* (('wait'))N-gram is slower than word based approach (textsearch approach)\n
|
319
|
+
(('note:N-gramは単語ベースのやり方(textsearchのやり方)より遅め'))
|
320
|
+
* (('wait'))Stemming/stop word can't be used\n
|
321
|
+
(('note:N-gramではステミングとストップワードを使えない'))
|
322
|
+
|
323
|
+
(('note:(*) English≒Alphabet based languages'))
|
324
|
+
|
325
|
+
= PGroonga and English\n(('note:PGroongaと英語'))
|
326
|
+
|
327
|
+
* PGroonga uses N-gram (('note:by default'))\n
|
328
|
+
(('note:PGroongaはデフォルトではN-gramを使う'))
|
329
|
+
* Is PGroonga slow for English?\n
|
330
|
+
(('note:ではPGroongaは英語では遅いのか?'))
|
331
|
+
* (('wait'))No. Similar to textsearch\n
|
332
|
+
(('note:遅くない。textsearchと同じくらい'))
|
333
|
+
|
334
|
+
= PGroonga: Search\n(('note:PGroonga:検索'))
|
335
|
+
|
336
|
+
# image
|
337
|
+
# src = images/search-pgroonga-textsearch.pdf
|
338
|
+
# relative_height = 100
|
339
|
+
|
340
|
+
= PGroonga's N-gram
|
341
|
+
|
342
|
+
* Variable size N-gram\n
|
343
|
+
(('note:可変長サイズのN-gram'))
|
344
|
+
* Continuous alphabets are 1 token\n
|
345
|
+
(= word based approach)\n
|
346
|
+
(('note:連続したアルファベットは1トークン(=単語ベース)'))\n
|
347
|
+
Hello→"Hello" not "He","el",…
|
348
|
+
* No alphabet is 2-gram\n
|
349
|
+
(('note:非アルファベットは2-gram'))\n
|
350
|
+
こんにちは→"こん","んに",…
|
351
|
+
|
352
|
+
= Wrap up1\n(('note:まとめ1'))
|
353
|
+
|
354
|
+
* PGroonga's search is fast for all languages\n
|
355
|
+
(('note:PGroongaの検索はすべての言語で速い'))
|
356
|
+
* Including alphabet based languages and Asian languages mixed case\n
|
357
|
+
(('note:アルファベットベースの言語とアジアの言語が混ざった場合でも速い'))\n
|
358
|
+
(('note:(textsearch doesn't support mixed case)'))\n
|
359
|
+
(('note:(textsearchは言語を混ぜることはできない)'))
|
360
|
+
|
361
|
+
= Wrap up2\n(('note:まとめ2'))
|
362
|
+
|
363
|
+
(('tag:center'))
|
364
|
+
PGroonga makes PostgreSQL\n
|
365
|
+
fast full text search platform\n
|
366
|
+
for all languages!
|
367
|
+
|
368
|
+
(('tag:center'))
|
369
|
+
(('note:PGroongaでPostgreSQLが'))\n
|
370
|
+
(('note:全言語対応高速全文検索プラットフォームになる!'))
|
371
|
+
|
372
|
+
= More about PGroonga\n(('note:PGroongaについてもっと'))
|
373
|
+
|
374
|
+
* Performance\n
|
375
|
+
(('note:性能'))
|
376
|
+
* JSON support\n
|
377
|
+
(('note:JSONサポート'))
|
378
|
+
* Replication\n
|
379
|
+
(('note:レプリケーション'))
|
380
|
+
|
381
|
+
= Performance\n(('note:性能'))
|
382
|
+
|
383
|
+
* Search and update\n(('note:検索と更新'))
|
384
|
+
* Index only scan\n(('note:インデックスオンリースキャン'))
|
385
|
+
* Direct Groonga search\n(('note:直接Groongaで検索'))
|
386
|
+
* Index creation\n(('note:インデックス作成'))
|
387
|
+
|
388
|
+
= Search and update\n(('note:検索と更新'))
|
389
|
+
|
390
|
+
* Doesn't decrease search performance while updating\n
|
391
|
+
(('note:更新中も検索性能が落ちない'))
|
392
|
+
|
393
|
+
= Characteristics\n(('note:傾向'))
|
394
|
+
|
395
|
+
# image
|
396
|
+
# src = images/performance-charcteristic-for-constant-read-and-write.svg
|
397
|
+
# relative_height = 100
|
398
|
+
|
399
|
+
= Update and lock\n(('note:更新とロック'))
|
400
|
+
|
401
|
+
* Update without ((*read*)) locks\n
|
402
|
+
(('note:((*参照*))ロックなしで更新'))
|
403
|
+
* ((*Write*)) locks are required\n
|
404
|
+
(('note:((*書き込み*))ロックは必要'))
|
405
|
+
|
406
|
+
= GIN: Read/Write\n(('note:GIN:読み書き'))
|
407
|
+
|
408
|
+
# image
|
409
|
+
# src = images/read-while-write-gin.svg
|
410
|
+
# relative_height = 100
|
411
|
+
|
412
|
+
= PGroonga: Read/Write\n(('note:PGroonga:読み書き'))
|
413
|
+
|
414
|
+
# image
|
415
|
+
# src = images/read-while-write-pgroonga.svg
|
416
|
+
# relative_height = 100
|
417
|
+
|
418
|
+
= Fast stably\n(('note:安定して速い'))
|
419
|
+
|
420
|
+
* GIN has intermittent performance decrements\n
|
421
|
+
(('note:GINは間欠的な性能劣化がある'))
|
422
|
+
* For details:🔎"GIN pending list"\n
|
423
|
+
(('note:詳細は「GIN pending list」で検索'))
|
424
|
+
* PGroonga keeps fast search\n
|
425
|
+
(('note:PGroongaは高速な検索を維持'))
|
426
|
+
* PGroonga keeps index latest\n
|
427
|
+
(('note:PGroongaのインデックスは常に最新状態'))
|
428
|
+
|
429
|
+
= Index only scan\n(('note:インデックスオンリースキャン'))
|
430
|
+
|
431
|
+
* GIN: Not supported\n
|
432
|
+
(('note:GIN:未サポート'))
|
433
|
+
* PGroonga: Supported\n
|
434
|
+
(('note:PGroonga:サポート'))
|
435
|
+
|
436
|
+
= More faster search\n(('note:より高速な検索'))
|
437
|
+
|
438
|
+
* Direct Groonga search is more faster\n
|
439
|
+
(('note:直接Groongaで検索するとさらに高速'))
|
440
|
+
* Groonga: Full text search engine PGroonga uses\n
|
441
|
+
(('note:Groonga:PGroongaが使っている全文検索エンジン'))
|
442
|
+
|
443
|
+
= Direct Groonga search\n(('note:直接Groongaで検索'))
|
444
|
+
|
445
|
+
# image
|
446
|
+
# src = images/search-pgroonga-groonga-textsearch.pdf
|
447
|
+
# relative_height = 100
|
448
|
+
|
449
|
+
= Index creation time\n(('note:インデックス作成時間'))
|
450
|
+
|
451
|
+
# image
|
452
|
+
# src = images/index-creation-en.pdf
|
453
|
+
# relative_height = 100
|
454
|
+
|
455
|
+
= Performance: Wrap up\n(('note:性能:まとめ'))
|
456
|
+
|
457
|
+
* Keep fast search with update\n
|
458
|
+
(('note:更新しながらでも高速検索を維持'))
|
459
|
+
* Support index only scan\n
|
460
|
+
(('note:インデックスオンリースキャンをサポート'))
|
461
|
+
* Direct Groonga search is more faster\n
|
462
|
+
(('note:Groonga直接検索はもっと速い'))
|
463
|
+
* Fast index creation\n
|
464
|
+
(('note:インデックス作成も速い'))
|
465
|
+
|
466
|
+
= JSON support\n(('note:JSONサポート'))
|
467
|
+
|
468
|
+
* Support full text search\n
|
469
|
+
(('note:全文検索対応'))
|
470
|
+
* Target: All texts in JSON\n
|
471
|
+
(('note:JSON内のすべてのテキスト'))
|
472
|
+
* Not only a text in a path\n
|
473
|
+
(('note:特定のパスのテキストだけではない'))\n
|
474
|
+
(('note:(GIN supports only this style)'))\n
|
475
|
+
(('note:(GINはこのやり方だけサポート)'))
|
476
|
+
|
477
|
+
= JSON: FTS\n(('note:JSON:全文検索'))
|
478
|
+
|
479
|
+
# coderay sql
|
480
|
+
INSERT INTO logs (record)
|
481
|
+
VALUES ('{"host": "app1"}'),
|
482
|
+
('{"message": "app is down"}');
|
483
|
+
SELECT * FROM logs
|
484
|
+
WHERE record @@ 'string @@ "app"'
|
485
|
+
-- record
|
486
|
+
-- --------------------------
|
487
|
+
-- {"host": "app1"}
|
488
|
+
-- {"message": "app is down"}
|
489
|
+
|
490
|
+
= JSON: Wrap up\n(('note:JSON:まとめ'))
|
491
|
+
|
492
|
+
* Support full text search against all texts in JSON\n
|
493
|
+
(('note:JSON内の全テキスト対象の全文検索をサポート'))
|
494
|
+
|
495
|
+
= Replication\n(('note:レプリケーション'))
|
496
|
+
|
497
|
+
* Support with PostgreSQL 9.6!\n
|
498
|
+
(('note:PostgreSQL 9.6で使う場合はサポート!'))
|
499
|
+
* PostgreSQL 9.6 ships "generic WAL"\n
|
500
|
+
(('note:PostgreSQL 9.6で「generic WAL」機能が追加'))
|
501
|
+
* Third party index can support WAL generation\n
|
502
|
+
(('note:サードパーティーのインデックスもWALを生成できる'))
|
503
|
+
|
504
|
+
= Implementation\n(('note:実装'))
|
505
|
+
|
506
|
+
(1) Master: Encode action logs as MessagePack\n
|
507
|
+
(('note:マスター:アクションログをMessagePackでエンコード'))
|
508
|
+
(2) Master: Write the action logs to WAL\n
|
509
|
+
(('note:マスター:アクションログをWALに書き込み'))
|
510
|
+
(3) Slaves: Read the action logs and apply them\n
|
511
|
+
(('note:スレーブ:アクションログを読み込んで適用'))
|
512
|
+
|
513
|
+
= Overview\n(('note:概要'))
|
514
|
+
|
515
|
+
# image
|
516
|
+
# src = images/replication-overview.svg
|
517
|
+
# relative_width = 100
|
518
|
+
|
519
|
+
= Action log: "action"\n(('note:アクションログ:「アクション」'))
|
520
|
+
|
521
|
+
{
|
522
|
+
"_action": ACTION_ID
|
523
|
+
}
|
524
|
+
# ACTION_ID: 0: INSERT
|
525
|
+
# ACTION_ID: 1: CREATE_TABLE
|
526
|
+
# ACTION_ID: 2: CREATE_COLUMN
|
527
|
+
# ACTION_ID: 3: SET_SOURCES
|
528
|
+
|
529
|
+
= Action log: INSERT\n(('note:アクションログ:INSERT'))
|
530
|
+
|
531
|
+
{
|
532
|
+
"_action": 0,
|
533
|
+
"_table": "TABLE_NAME",
|
534
|
+
"ctid": PACKED_CTID_VALUE,
|
535
|
+
"column1": COLUMN1_VALUE,
|
536
|
+
...
|
537
|
+
}
|
538
|
+
|
539
|
+
= Action log: Logs\n(('note:アクションログ:複数ログ'))
|
540
|
+
|
541
|
+
{"_action": ACTION_ID, ...}
|
542
|
+
{"_action": ACTION_ID, ...}
|
543
|
+
{"_action": ACTION_ID, ...}
|
544
|
+
...
|
545
|
+
|
546
|
+
= Write action logs\n(('note:アクションログの書き込み'))
|
547
|
+
|
548
|
+
# image
|
549
|
+
# src = images/replication-write-action-logs.svg
|
550
|
+
# relative_height = 100
|
551
|
+
|
552
|
+
= Apply action logs\n(('note:アクションログの適用'))
|
553
|
+
|
554
|
+
# image
|
555
|
+
# src = images/replication-apply-action-logs.svg
|
556
|
+
# relative_height = 100
|
557
|
+
|
558
|
+
= Action log: Why msgpack?\n(('note:アクションログ:どうしてmsgpack?'))
|
559
|
+
|
560
|
+
* Because MessagePack supports streaming unpack\n
|
561
|
+
(('note:MessagePackはストリーミングで展開できるから'))
|
562
|
+
* It's useful to stop applying action logs when WAL is applied partially on slaves\n
|
563
|
+
(('note:スレーブでWALが途中までしか書き込まれていないときにアクションログの適用を中断できるので便利'))
|
564
|
+
|
565
|
+
= Replication: Wrap up\n(('note:レプリケーション:まとめ'))
|
566
|
+
|
567
|
+
* Support with PostgreSQL 9.6!\n
|
568
|
+
(('note:PostgreSQL 9.6で使う場合はサポート!'))
|
569
|
+
* Concept: Action logs on WAL\n
|
570
|
+
(('note:コンセプト:WAL上にアクションログを書く'))
|
571
|
+
* It'll be an useful pattern for out of PostgreSQL storage index\n
|
572
|
+
(('note:PostgreSQL管理外のストレージを使うインデックスではこのパターンが使えるはず'))
|
573
|
+
|
574
|
+
= Wrap up1\n(('note:まとめ1'))
|
575
|
+
|
576
|
+
* PostgreSQL doesn't support FTS for all languages\n
|
577
|
+
(('note:PostgreSQLの全文検索は一部の言語のみ対応'))
|
578
|
+
* PGroonga supports FTS for all languages\n
|
579
|
+
(('note:PGroongaの全文検索は全言語対応'))
|
580
|
+
|
581
|
+
= Wrap up2\n(('note:まとめ2'))
|
582
|
+
|
583
|
+
* PGroonga is fast stably\n
|
584
|
+
(('note:PGroongaは安定して速い'))
|
585
|
+
* PGroonga supports FTS for all texts in JSON\n
|
586
|
+
(('note:PGroongaはJSON中の全テキストに対する全文検索に対応'))
|
587
|
+
|
588
|
+
= Wrap up3\n(('note:まとめ3'))
|
589
|
+
|
590
|
+
* PGroonga supports replication\n
|
591
|
+
(('note:PGroongaはレプリケーション対応'))
|
592
|
+
* PostgreSQL 9.6 is required\n
|
593
|
+
(('note:ただしPostgreSQL 9.6が必要'))
|
594
|
+
|
595
|
+
= Wrap up4\n(('note:まとめ4'))
|
596
|
+
|
597
|
+
(('tag:center'))
|
598
|
+
PGroonga makes PostgreSQL\n
|
599
|
+
fast full text search platform\n
|
600
|
+
for all languages!
|
601
|
+
|
602
|
+
(('tag:center'))
|
603
|
+
(('note:PGroongaでPostgreSQLが'))\n
|
604
|
+
(('note:全言語対応高速全文検索プラットフォームになる!'))
|
605
|
+
|
606
|
+
= See also
|
607
|
+
|
608
|
+
((<"https://pgroonga.github.io/"|URL:https://pgroonga.github.io/>))
|
609
|
+
|
610
|
+
* Tutorial: ((<"/tutorial/"|URL:https://pgroonga.github.io/tutorial/>))
|
611
|
+
* Install: ((<"/install/"|URL:https://pgroonga.github.io/install/>))
|
612
|
+
* Reference: ((<"/reference/"|URL:https://pgroonga.github.io/reference/>))
|
613
|
+
* Includes replication doc and benchmark docs
|
614
|
+
* Community: ((<"/community/"|URL:https://pgroonga.github.io/community/>))
|