-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrin.html
More file actions
542 lines (536 loc) · 76.3 KB
/
brin.html
File metadata and controls
542 lines (536 loc) · 76.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>65.5. BRINインデックス</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="gin.html" title="65.4. GINインデックス" /><link rel="next" href="hash-index.html" title="65.6. ハッシュインデックス" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body id="docContent" class="container-fluid col-10"><div class="other_version"><a href="https://www.postgresql.jp/document/">バージョンごとのドキュメント一覧</a></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 18.3文書</a></th></tr><tr><td width="10%" align="left"></td><td width="10%" align="left"></td><td width="60%" align="center"><a href="indextypes.html" title="第65章 組み込みインデックスアクセスメソッド">第65章 組み込みインデックスアクセスメソッド</a></td><td width="20%" align="right"><div class="actions"><a class="issue" title="github" href="https://github.com/pgsql-jp/jpug-doc/issues/new?template=bug_report.yml&what-happened=version 18.3 : brin.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="gin.html" title="65.4. GINインデックス">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="indextypes.html" title="第65章 組み込みインデックスアクセスメソッド">上へ</a></td><td width="60%" align="center">65.5. BRINインデックス</td><td width="20%" align="right"> <a accesskey="n" href="hash-index.html" title="65.6. ハッシュインデックス">次へ</a></td></tr></table><hr /></div><div class="sect1" id="BRIN"><div class="titlepage"><div><div><h2 class="title" style="clear: both">65.5. BRINインデックス <a href="#BRIN" class="id_link">#</a></h2></div></div></div><span class="original">
<title>BRIN Indexes</title>
</span><a id="id-1.10.17.6.2" class="indexterm"></a><div class="sect2" id="BRIN-INTRO"><div class="titlepage"><div><div><h3 class="title">65.5.1. はじめに <a href="#BRIN-INTRO" class="id_link">#</a></h3></div></div></div><span class="original">
<title>Introduction</title>
</span><p>
<span class="original">
<acronym>BRIN</acronym> stands for Block Range Index.
<acronym>BRIN</acronym> is designed for handling very large tables
in which certain columns have some natural correlation with their
physical location within the table.
</span>
<acronym class="acronym">BRIN</acronym>は「ブロックレンジインデックス」(Block Range Index)の略です。
<acronym class="acronym">BRIN</acronym>は、ある列がテーブル内の物理的な位置と自然な相関があるような、非常に大規模なテーブルのために設計されています。
</p><p>
<span class="original">
<acronym>BRIN</acronym> works in terms of <firstterm>block ranges</firstterm>
(or <quote>page ranges</quote>).
A block range is a group of pages that are physically
adjacent in the table; for each block range, some summary info is stored
by the index.
For example, a table storing a store's sale orders might have
a date column on which each order was placed, and most of the time
the entries for earlier orders will appear earlier in the table as well;
a table storing a ZIP code column might have all codes for a city
grouped together naturally.
</span>
<acronym class="acronym">BRIN</acronym>は<em class="firstterm">ブロックレンジ(block range)</em>(または<span class="quote">「<span class="quote">ページレンジ(page range)</span>」</span>)として動作します。
<em class="firstterm">ブロックレンジ(block range)</em>は、テーブル内で物理的に隣接するページのグループです。それぞれのブロックレンジに対して、ある種の要約情報がインデックス内に格納されます。
たとえば、店舗の受注情報を格納するテーブルは、各々の受注時期を格納する日付列を持つでしょう。大抵の場合、より前の受注エントリは、テーブルのより前の方にあるでしょう。
郵便番号を管理するテーブルでは、ある市に属する郵便番号が自然にグループ化されることになるでしょう。
</p><p>
<span class="original">
<acronym>BRIN</acronym> indexes can satisfy queries via regular bitmap
index scans, and will return all tuples in all pages within each range if
the summary info stored by the index is <firstterm>consistent</firstterm> with the
query conditions.
The query executor is in charge of rechecking these tuples and discarding
those that do not match the query conditions &mdash; in other words, these
indexes are lossy.
Because a <acronym>BRIN</acronym> index is very small, scanning the index
adds little overhead compared to a sequential scan, but may avoid scanning
large parts of the table that are known not to contain matching tuples.
</span>
<acronym class="acronym">BRIN</acronym>インデックスは、通常のビットマップインデックススキャンを通じて要求されるクエリに使用することができます。
すなわち、インデックス内のレンジ要約情報が検索条件と<em class="firstterm">一致</em>すれば、<acronym class="acronym">BRIN</acronym>インデックスは各レンジ内のすべてのページにあるすべてのタプルを返します。
クエリエグゼキュータの役割は、検索条件を再チェックし、条件に合致しないタプルを捨てることです。
つまり言い換えると、<acronym class="acronym">BRIN</acronym>インデックスには損失性があります。
<acronym class="acronym">BRIN</acronym>インデックスは非常に小さいため、それに対するスキャンはシーケンシャルスキャンに比べると小さなオーバーヘッドしか与えません。しかし、あらかじめ条件に合致しないと分かっているテーブルの多くの部分をスキャンすることを避けることができます。
</p><p>
<span class="original">
The specific data that a <acronym>BRIN</acronym> index will store,
as well as the specific queries that the index will be able to satisfy,
depend on the operator class selected for each column of the index.
Data types having a linear sort order can have operator classes that
store the minimum and maximum value within each block range, for instance;
geometrical types might store the bounding box for all the objects
in the block range.
</span>
<acronym class="acronym">BRIN</acronym>インデックスに格納される特定のデータと、そのインデックスが対応できる特定のクエリは、インデックスに対応する各々の列に与えられた演算子クラスに依存します。
線形のソート順を持つデータ型は、ブロックレンジ内の最小値と最大値と格納する演算子クラスを持つことができます。
たとえば、幾何データ型は、ブロックレンジ内のすべてのオブジェクトを含む外接矩形を持つことでしょう。
</p><p>
<span class="original">
The size of the block range is determined at index creation time by
the <literal>pages_per_range</literal> storage parameter. The number of index
entries will be equal to the size of the relation in pages divided by
the selected value for <literal>pages_per_range</literal>. Therefore, the smaller
the number, the larger the index becomes (because of the need to
store more index entries), but at the same time the summary data stored can
be more precise and more data blocks can be skipped during an index scan.
</span>
ブロックレンジの大きさは、ストレージパラメータ<code class="literal">pages_per_range</code>でインデックス作成時に決定されます。
インデックスエントリの数は、リレーションのページ数を<code class="literal">pages_per_range</code>に設定した数で割ったものと等しくなります。
ですから、<code class="literal">pages_per_range</code>の設定値が小さいほど、インデックスは大きくなります(より多くのインデックスエントリを格納する必要があるので)が、反面、格納されたサマリデータはより精密になり、インデックススキャンの際により多くのデータブロックをスキップすることができるようになります。
</p><div class="sect3" id="BRIN-OPERATION"><div class="titlepage"><div><div><h4 class="title">65.5.1.1. インデックスの保守 <a href="#BRIN-OPERATION" class="id_link">#</a></h4></div></div></div><span class="original">
<title>Index Maintenance</title>
</span><p>
<span class="original">
At the time of creation, all existing heap pages are scanned and a
summary index tuple is created for each range, including the
possibly-incomplete range at the end.
As new pages are filled with data, page ranges that are already
summarized will cause the summary information to be updated with data
from the new tuples.
When a new page is created that does not fall within the last
summarized range, the range that the new page belongs to
does not automatically acquire a summary tuple;
those tuples remain unsummarized until a summarization run is
invoked later, creating the initial summary for that range.
</span>
インデックスを作成した当初は、すべてのヒープページがスキャンされ、終端が不完全なものも含め、各々のレンジに対してサマリインデックスタプルが作成されます。
新しいページにデータが登録されると、新しいタプルのデータを元に、すでにサマリ済みのページレンジのサマリ情報が更新されます。
最終サマリレンジに適合しない新しいページが作成されると、そのレンジに対して自動的にはサマリタプルが作成されません。
これらのタプルは、後でサマリ処理が走って初期サマリ情報が作成されるまではサマリされません。
</p><p>
<span class="original">
There are several ways to trigger the initial summarization of a page range.
If the table is vacuumed, either manually or by
<link linkend="autovacuum">autovacuum</link>, all existing unsummarized
page ranges are summarized.
Also, if the index's
<xref linkend="index-reloption-autosummarize"/> parameter is enabled,
which it isn't by default,
whenever autovacuum runs in that database, summarization will occur for all
unsummarized page ranges that have been filled,
regardless of whether the table itself is processed by autovacuum; see below.
</span>
ページレンジの初期サマリ処理を起動する複数の方法があります。
手動あるいは<a class="link" href="routine-vacuuming.html#AUTOVACUUM" title="24.1.6. 自動バキュームデーモン">autovacuum</a>のどちらでも良いですが、テーブルがバキュームされるとすべてのまだサマライズされていないページレンジがサマライズされます。
また、インデックスの<a class="xref" href="sql-createindex.html#INDEX-RELOPTION-AUTOSUMMARIZE">autosummarize</a>パラメータが有効なら、これはデフォルトでは有効ではありませんが、そのデータベースに対してバキュームが実行されると、自動バキュームによってそのテーブル自体が処理されるかどうかにかかわらず、すべての挿入された未サマリページレンジに対してサマリ処理が実行されます。
以下を見てください。
</p><p>
<span class="original">
Lastly, the following functions can be used (while these functions run,
<xref linkend="guc-search-path"/> is temporarily changed to
<literal>pg_catalog, pg_temp</literal>):
</span>
最後に、次の関数を使用できます(これらの関数の実行中、<a class="xref" href="runtime-config-client.html#GUC-SEARCH-PATH">search_path</a>は一時的に<code class="literal">pg_catalog, pg_temp</code>に変更されます)。
</p><table border="0" summary="Simple list" class="simplelist"><tr><td>
<span class="original">
<function>brin_summarize_new_values(regclass)</function>
which summarizes all unsummarized ranges;
</span>
すべての未サマリレンジをサマライズする<code class="function">brin_summarize_new_values(regclass)</code>
</td></tr><tr><td>
<span class="original">
<function>brin_summarize_range(regclass, bigint)</function>
which summarizes only the range containing the given page,
if it is unsummarized.
</span>
もしまだサマライズされていなければ、指定されたページを含む指定されたレンジのみをサマライズする<code class="function">brin_summarize_range(regclass, bigint)</code>
</td></tr></table><p>
</p><p>
<span class="original">
When autosummarization is enabled, a request is sent to
<literal>autovacuum</literal> to execute a targeted summarization
for a block range when an insertion is detected for the first item
of the first page of the next block range,
to be fulfilled the next time an autovacuum
worker finishes running in the
same database. If the request queue is full, the request is not recorded
and a message is sent to the server log:
</span>
自動サマリ機能が有効な場合、次のブロックレンジの最初のページの最初の項目の挿入が検出されると、同じデータベースで実行中の自動バキュームワーカーの次の実行の終了時に処理されるブロックレンジをターゲットとするサマリ機能を実行する要求が<code class="literal">autovacuum</code>に送信されます。
もしリクエストキューが満杯ならばそのリクエストは記録されず、次のメッセージがサーバのログに送信されます。
</p><pre class="screen">
LOG: request for BRIN range summarization for index "brin_wi_idx" page 128 was not recorded
</pre><p>
<span class="original">
When this happens, the range will remain unsummarized until the next
regular vacuum run on the table, or one of the functions mentioned above
are invoked.
</span>
この状態が発生すると、テーブルの次の通常バキュームが実行されるか、上で述べた関数のどれかが実行されるまでは、そのレンジはサマライズされない状態にとどまります。
</p><p>
<span class="original">
Conversely, a range can be de-summarized using the
<function>brin_desummarize_range(regclass, bigint)</function> function,
which is useful when the index tuple is no longer a very good
representation because the existing values have changed.
See <xref linkend="functions-admin-index"/> for details.
</span>
反対に、レンジは<code class="function">brin_desummarize_range(regclass, bigint)</code>関数で非サマリ化できます。
これは、既存の値が変更されたためにインデックスタプルがもはや値の表現としては適当でなくなった場合に有効です。
詳細は<a class="xref" href="functions-admin.html#FUNCTIONS-ADMIN-INDEX" title="9.28.8. インデックス保守関数">9.28.8</a>を見てください。
</p></div></div><div class="sect2" id="BRIN-BUILTIN-OPCLASSES"><div class="titlepage"><div><div><h3 class="title">65.5.2. 組み込み演算子クラス <a href="#BRIN-BUILTIN-OPCLASSES" class="id_link">#</a></h3></div></div></div><span class="original">
<title>Built-in Operator Classes</title>
</span><p>
<span class="original">
The core <productname>PostgreSQL</productname> distribution
includes the <acronym>BRIN</acronym> operator classes shown in
<xref linkend="brin-builtin-opclasses-table"/>.
</span>
<span class="productname">PostgreSQL</span>のコア配布物には、<a class="xref" href="brin.html#BRIN-BUILTIN-OPCLASSES-TABLE" title="表65.4 組み込みBRIN演算子クラス">表 65.4</a>で示される<acronym class="acronym">BRIN</acronym>演算子クラスが含まれます。
</p><p>
<span class="original">
The <firstterm>minmax</firstterm>
operator classes store the minimum and the maximum values appearing
in the indexed column within the range. The <firstterm>inclusion</firstterm>
operator classes store a value which includes the values in the indexed
column within the range. The <firstterm>bloom</firstterm> operator
classes build a Bloom filter for all values in the range. The
<firstterm>minmax-multi</firstterm> operator classes store multiple
minimum and maximum values, representing values appearing in the indexed
column within the range.
</span>
<em class="firstterm">minmax</em>演算子クラスは、インデックスが貼られた列の範囲内に現れる最小値と最大値を格納します。
<em class="firstterm">inclusion</em>演算子クラスは、インデックスが貼られた列の範囲内に含まれる値を格納します。
<em class="firstterm">bloom</em>演算子クラスは、その範囲内のすべての値に対してブルームフィルタを構築します。
<em class="firstterm">minmax-multi</em>演算子クラスは、インデックスが貼られた列の範囲内に現れる複数の最小値と最大値、代表値を格納します。
</p><div class="table" id="BRIN-BUILTIN-OPCLASSES-TABLE"><p class="title"><strong>表65.4 組み込み<acronym class="acronym">BRIN</acronym>演算子クラス</strong></p><div class="table-contents"><span class="original">
<title>Built-in <acronym>BRIN</acronym> Operator Classes</title>
</span><table class="table" summary="組み込みBRIN演算子クラス" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>名前</th><th>インデックス可能な演算子</th></tr></thead><tbody><tr><td rowspan="5" valign="middle"><code class="literal">bit_minmax_ops</code></td><td><code class="literal">= (bit,bit)</code></td></tr><tr><td><code class="literal">< (bit,bit)</code></td></tr><tr><td><code class="literal">> (bit,bit)</code></td></tr><tr><td><code class="literal"><= (bit,bit)</code></td></tr><tr><td><code class="literal">>= (bit,bit)</code></td></tr><tr><td rowspan="13" valign="middle"><code class="literal">box_inclusion_ops</code></td><td><code class="literal">@> (box,point)</code></td></tr><tr><td><code class="literal"><< (box,box)</code></td></tr><tr><td><code class="literal">&< (box,box)</code></td></tr><tr><td><code class="literal">&> (box,box)</code></td></tr><tr><td><code class="literal">>> (box,box)</code></td></tr><tr><td><code class="literal"><@ (box,box)</code></td></tr><tr><td><code class="literal">@> (box,box)</code></td></tr><tr><td><code class="literal">~= (box,box)</code></td></tr><tr><td><code class="literal">&& (box,box)</code></td></tr><tr><td><code class="literal"><<| (box,box)</code></td></tr><tr><td><code class="literal">&<| (box,box)</code></td></tr><tr><td><code class="literal">|&> (box,box)</code></td></tr><tr><td><code class="literal">|>> (box,box)</code></td></tr><tr><td valign="middle"><code class="literal">bpchar_bloom_ops</code></td><td><code class="literal">= (character,character)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">bpchar_minmax_ops</code></td><td><code class="literal">= (character,character)</code></td></tr><tr><td><code class="literal">< (character,character)</code></td></tr><tr><td><code class="literal"><= (character,character)</code></td></tr><tr><td><code class="literal">> (character,character)</code></td></tr><tr><td><code class="literal">>= (character,character)</code></td></tr><tr><td valign="middle"><code class="literal">bytea_bloom_ops</code></td><td><code class="literal">= (bytea,bytea)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">bytea_minmax_ops</code></td><td><code class="literal">= (bytea,bytea)</code></td></tr><tr><td><code class="literal">< (bytea,bytea)</code></td></tr><tr><td><code class="literal"><= (bytea,bytea)</code></td></tr><tr><td><code class="literal">> (bytea,bytea)</code></td></tr><tr><td><code class="literal">>= (bytea,bytea)</code></td></tr><tr><td valign="middle"><code class="literal">char_bloom_ops</code></td><td><code class="literal">= ("char","char")</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">char_minmax_ops</code></td><td><code class="literal">= ("char","char")</code></td></tr><tr><td><code class="literal">< ("char","char")</code></td></tr><tr><td><code class="literal"><= ("char","char")</code></td></tr><tr><td><code class="literal">> ("char","char")</code></td></tr><tr><td><code class="literal">>= ("char","char")</code></td></tr><tr><td valign="middle"><code class="literal">date_bloom_ops</code></td><td><code class="literal">= (date,date)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">date_minmax_ops</code></td><td><code class="literal">= (date,date)</code></td></tr><tr><td><code class="literal">< (date,date)</code></td></tr><tr><td><code class="literal"><= (date,date)</code></td></tr><tr><td><code class="literal">> (date,date)</code></td></tr><tr><td><code class="literal">>= (date,date)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">date_minmax_multi_ops</code></td><td><code class="literal">= (date,date)</code></td></tr><tr><td><code class="literal">< (date,date)</code></td></tr><tr><td><code class="literal"><= (date,date)</code></td></tr><tr><td><code class="literal">> (date,date)</code></td></tr><tr><td><code class="literal">>= (date,date)</code></td></tr><tr><td valign="middle"><code class="literal">float4_bloom_ops</code></td><td><code class="literal">= (float4,float4)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">float4_minmax_ops</code></td><td><code class="literal">= (float4,float4)</code></td></tr><tr><td><code class="literal">< (float4,float4)</code></td></tr><tr><td><code class="literal">> (float4,float4)</code></td></tr><tr><td><code class="literal"><= (float4,float4)</code></td></tr><tr><td><code class="literal">>= (float4,float4)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">float4_minmax_multi_ops</code></td><td><code class="literal">= (float4,float4)</code></td></tr><tr><td><code class="literal">< (float4,float4)</code></td></tr><tr><td><code class="literal">> (float4,float4)</code></td></tr><tr><td><code class="literal"><= (float4,float4)</code></td></tr><tr><td><code class="literal">>= (float4,float4)</code></td></tr><tr><td valign="middle"><code class="literal">float8_bloom_ops</code></td><td><code class="literal">= (float8,float8)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">float8_minmax_ops</code></td><td><code class="literal">= (float8,float8)</code></td></tr><tr><td><code class="literal">< (float8,float8)</code></td></tr><tr><td><code class="literal"><= (float8,float8)</code></td></tr><tr><td><code class="literal">> (float8,float8)</code></td></tr><tr><td><code class="literal">>= (float8,float8)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">float8_minmax_multi_ops</code></td><td><code class="literal">= (float8,float8)</code></td></tr><tr><td><code class="literal">< (float8,float8)</code></td></tr><tr><td><code class="literal"><= (float8,float8)</code></td></tr><tr><td><code class="literal">> (float8,float8)</code></td></tr><tr><td><code class="literal">>= (float8,float8)</code></td></tr><tr><td rowspan="6" valign="middle"><code class="literal">inet_inclusion_ops</code></td><td><code class="literal"><< (inet,inet)</code></td></tr><tr><td><code class="literal"><<= (inet,inet)</code></td></tr><tr><td><code class="literal">>> (inet,inet)</code></td></tr><tr><td><code class="literal">>>= (inet,inet)</code></td></tr><tr><td><code class="literal">= (inet,inet)</code></td></tr><tr><td><code class="literal">&& (inet,inet)</code></td></tr><tr><td valign="middle"><code class="literal">inet_bloom_ops</code></td><td><code class="literal">= (inet,inet)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">inet_minmax_ops</code></td><td><code class="literal">= (inet,inet)</code></td></tr><tr><td><code class="literal">< (inet,inet)</code></td></tr><tr><td><code class="literal"><= (inet,inet)</code></td></tr><tr><td><code class="literal">> (inet,inet)</code></td></tr><tr><td><code class="literal">>= (inet,inet)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">inet_minmax_multi_ops</code></td><td><code class="literal">= (inet,inet)</code></td></tr><tr><td><code class="literal">< (inet,inet)</code></td></tr><tr><td><code class="literal"><= (inet,inet)</code></td></tr><tr><td><code class="literal">> (inet,inet)</code></td></tr><tr><td><code class="literal">>= (inet,inet)</code></td></tr><tr><td valign="middle"><code class="literal">int2_bloom_ops</code></td><td><code class="literal">= (int2,int2)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">int2_minmax_ops</code></td><td><code class="literal">= (int2,int2)</code></td></tr><tr><td><code class="literal">< (int2,int2)</code></td></tr><tr><td><code class="literal">> (int2,int2)</code></td></tr><tr><td><code class="literal"><= (int2,int2)</code></td></tr><tr><td><code class="literal">>= (int2,int2)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">int2_minmax_multi_ops</code></td><td><code class="literal">= (int2,int2)</code></td></tr><tr><td><code class="literal">< (int2,int2)</code></td></tr><tr><td><code class="literal">> (int2,int2)</code></td></tr><tr><td><code class="literal"><= (int2,int2)</code></td></tr><tr><td><code class="literal">>= (int2,int2)</code></td></tr><tr><td valign="middle"><code class="literal">int4_bloom_ops</code></td><td><code class="literal">= (int4,int4)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">int4_minmax_ops</code></td><td><code class="literal">= (int4,int4)</code></td></tr><tr><td><code class="literal">< (int4,int4)</code></td></tr><tr><td><code class="literal">> (int4,int4)</code></td></tr><tr><td><code class="literal"><= (int4,int4)</code></td></tr><tr><td><code class="literal">>= (int4,int4)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">int4_minmax_multi_ops</code></td><td><code class="literal">= (int4,int4)</code></td></tr><tr><td><code class="literal">< (int4,int4)</code></td></tr><tr><td><code class="literal">> (int4,int4)</code></td></tr><tr><td><code class="literal"><= (int4,int4)</code></td></tr><tr><td><code class="literal">>= (int4,int4)</code></td></tr><tr><td valign="middle"><code class="literal">int8_bloom_ops</code></td><td><code class="literal">= (bigint,bigint)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">int8_minmax_ops</code></td><td><code class="literal">= (bigint,bigint)</code></td></tr><tr><td><code class="literal">< (bigint,bigint)</code></td></tr><tr><td><code class="literal">> (bigint,bigint)</code></td></tr><tr><td><code class="literal"><= (bigint,bigint)</code></td></tr><tr><td><code class="literal">>= (bigint,bigint)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">int8_minmax_multi_ops</code></td><td><code class="literal">= (bigint,bigint)</code></td></tr><tr><td><code class="literal">< (bigint,bigint)</code></td></tr><tr><td><code class="literal">> (bigint,bigint)</code></td></tr><tr><td><code class="literal"><= (bigint,bigint)</code></td></tr><tr><td><code class="literal">>= (bigint,bigint)</code></td></tr><tr><td valign="middle"><code class="literal">interval_bloom_ops</code></td><td><code class="literal">= (interval,interval)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">interval_minmax_ops</code></td><td><code class="literal">= (interval,interval)</code></td></tr><tr><td><code class="literal">< (interval,interval)</code></td></tr><tr><td><code class="literal"><= (interval,interval)</code></td></tr><tr><td><code class="literal">> (interval,interval)</code></td></tr><tr><td><code class="literal">>= (interval,interval)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">interval_minmax_multi_ops</code></td><td><code class="literal">= (interval,interval)</code></td></tr><tr><td><code class="literal">< (interval,interval)</code></td></tr><tr><td><code class="literal"><= (interval,interval)</code></td></tr><tr><td><code class="literal">> (interval,interval)</code></td></tr><tr><td><code class="literal">>= (interval,interval)</code></td></tr><tr><td valign="middle"><code class="literal">macaddr_bloom_ops</code></td><td><code class="literal">= (macaddr,macaddr)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">macaddr_minmax_ops</code></td><td><code class="literal">= (macaddr,macaddr)</code></td></tr><tr><td><code class="literal">< (macaddr,macaddr)</code></td></tr><tr><td><code class="literal"><= (macaddr,macaddr)</code></td></tr><tr><td><code class="literal">> (macaddr,macaddr)</code></td></tr><tr><td><code class="literal">>= (macaddr,macaddr)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">macaddr_minmax_multi_ops</code></td><td><code class="literal">= (macaddr,macaddr)</code></td></tr><tr><td><code class="literal">< (macaddr,macaddr)</code></td></tr><tr><td><code class="literal"><= (macaddr,macaddr)</code></td></tr><tr><td><code class="literal">> (macaddr,macaddr)</code></td></tr><tr><td><code class="literal">>= (macaddr,macaddr)</code></td></tr><tr><td valign="middle"><code class="literal">macaddr8_bloom_ops</code></td><td><code class="literal">= (macaddr8,macaddr8)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">macaddr8_minmax_ops</code></td><td><code class="literal">= (macaddr8,macaddr8)</code></td></tr><tr><td><code class="literal">< (macaddr8,macaddr8)</code></td></tr><tr><td><code class="literal"><= (macaddr8,macaddr8)</code></td></tr><tr><td><code class="literal">> (macaddr8,macaddr8)</code></td></tr><tr><td><code class="literal">>= (macaddr8,macaddr8)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">macaddr8_minmax_multi_ops</code></td><td><code class="literal">= (macaddr8,macaddr8)</code></td></tr><tr><td><code class="literal">< (macaddr8,macaddr8)</code></td></tr><tr><td><code class="literal"><= (macaddr8,macaddr8)</code></td></tr><tr><td><code class="literal">> (macaddr8,macaddr8)</code></td></tr><tr><td><code class="literal">>= (macaddr8,macaddr8)</code></td></tr><tr><td valign="middle"><code class="literal">name_bloom_ops</code></td><td><code class="literal">= (name,name)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">name_minmax_ops</code></td><td><code class="literal">= (name,name)</code></td></tr><tr><td><code class="literal">< (name,name)</code></td></tr><tr><td><code class="literal"><= (name,name)</code></td></tr><tr><td><code class="literal">> (name,name)</code></td></tr><tr><td><code class="literal">>= (name,name)</code></td></tr><tr><td valign="middle"><code class="literal">numeric_bloom_ops</code></td><td><code class="literal">= (numeric,numeric)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">numeric_minmax_ops</code></td><td><code class="literal">= (numeric,numeric)</code></td></tr><tr><td><code class="literal">< (numeric,numeric)</code></td></tr><tr><td><code class="literal"><= (numeric,numeric)</code></td></tr><tr><td><code class="literal">> (numeric,numeric)</code></td></tr><tr><td><code class="literal">>= (numeric,numeric)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">numeric_minmax_multi_ops</code></td><td><code class="literal">= (numeric,numeric)</code></td></tr><tr><td><code class="literal">< (numeric,numeric)</code></td></tr><tr><td><code class="literal"><= (numeric,numeric)</code></td></tr><tr><td><code class="literal">> (numeric,numeric)</code></td></tr><tr><td><code class="literal">>= (numeric,numeric)</code></td></tr><tr><td valign="middle"><code class="literal">oid_bloom_ops</code></td><td><code class="literal">= (oid,oid)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">oid_minmax_ops</code></td><td><code class="literal">= (oid,oid)</code></td></tr><tr><td><code class="literal">< (oid,oid)</code></td></tr><tr><td><code class="literal">> (oid,oid)</code></td></tr><tr><td><code class="literal"><= (oid,oid)</code></td></tr><tr><td><code class="literal">>= (oid,oid)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">oid_minmax_multi_ops</code></td><td><code class="literal">= (oid,oid)</code></td></tr><tr><td><code class="literal">< (oid,oid)</code></td></tr><tr><td><code class="literal">> (oid,oid)</code></td></tr><tr><td><code class="literal"><= (oid,oid)</code></td></tr><tr><td><code class="literal">>= (oid,oid)</code></td></tr><tr><td valign="middle"><code class="literal">pg_lsn_bloom_ops</code></td><td><code class="literal">= (pg_lsn,pg_lsn)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">pg_lsn_minmax_ops</code></td><td><code class="literal">= (pg_lsn,pg_lsn)</code></td></tr><tr><td><code class="literal">< (pg_lsn,pg_lsn)</code></td></tr><tr><td><code class="literal">> (pg_lsn,pg_lsn)</code></td></tr><tr><td><code class="literal"><= (pg_lsn,pg_lsn)</code></td></tr><tr><td><code class="literal">>= (pg_lsn,pg_lsn)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">pg_lsn_minmax_multi_ops</code></td><td><code class="literal">= (pg_lsn,pg_lsn)</code></td></tr><tr><td><code class="literal">< (pg_lsn,pg_lsn)</code></td></tr><tr><td><code class="literal">> (pg_lsn,pg_lsn)</code></td></tr><tr><td><code class="literal"><= (pg_lsn,pg_lsn)</code></td></tr><tr><td><code class="literal">>= (pg_lsn,pg_lsn)</code></td></tr><tr><td rowspan="14" valign="middle"><code class="literal">range_inclusion_ops</code></td><td><code class="literal">= (anyrange,anyrange)</code></td></tr><tr><td><code class="literal">< (anyrange,anyrange)</code></td></tr><tr><td><code class="literal"><= (anyrange,anyrange)</code></td></tr><tr><td><code class="literal">>= (anyrange,anyrange)</code></td></tr><tr><td><code class="literal">> (anyrange,anyrange)</code></td></tr><tr><td><code class="literal">&& (anyrange,anyrange)</code></td></tr><tr><td><code class="literal">@> (anyrange,anyelement)</code></td></tr><tr><td><code class="literal">@> (anyrange,anyrange)</code></td></tr><tr><td><code class="literal"><@ (anyrange,anyrange)</code></td></tr><tr><td><code class="literal"><< (anyrange,anyrange)</code></td></tr><tr><td><code class="literal">>> (anyrange,anyrange)</code></td></tr><tr><td><code class="literal">&< (anyrange,anyrange)</code></td></tr><tr><td><code class="literal">&> (anyrange,anyrange)</code></td></tr><tr><td><code class="literal">-|- (anyrange,anyrange)</code></td></tr><tr><td valign="middle"><code class="literal">text_bloom_ops</code></td><td><code class="literal">= (text,text)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">text_minmax_ops</code></td><td><code class="literal">= (text,text)</code></td></tr><tr><td><code class="literal">< (text,text)</code></td></tr><tr><td><code class="literal"><= (text,text)</code></td></tr><tr><td><code class="literal">> (text,text)</code></td></tr><tr><td><code class="literal">>= (text,text)</code></td></tr><tr><td valign="middle"><code class="literal">tid_bloom_ops</code></td><td><code class="literal">= (tid,tid)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">tid_minmax_ops</code></td><td><code class="literal">= (tid,tid)</code></td></tr><tr><td><code class="literal">< (tid,tid)</code></td></tr><tr><td><code class="literal">> (tid,tid)</code></td></tr><tr><td><code class="literal"><= (tid,tid)</code></td></tr><tr><td><code class="literal">>= (tid,tid)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">tid_minmax_multi_ops</code></td><td><code class="literal">= (tid,tid)</code></td></tr><tr><td><code class="literal">< (tid,tid)</code></td></tr><tr><td><code class="literal">> (tid,tid)</code></td></tr><tr><td><code class="literal"><= (tid,tid)</code></td></tr><tr><td><code class="literal">>= (tid,tid)</code></td></tr><tr><td valign="middle"><code class="literal">timestamp_bloom_ops</code></td><td><code class="literal">= (timestamp,timestamp)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">timestamp_minmax_ops</code></td><td><code class="literal">= (timestamp,timestamp)</code></td></tr><tr><td><code class="literal">< (timestamp,timestamp)</code></td></tr><tr><td><code class="literal"><= (timestamp,timestamp)</code></td></tr><tr><td><code class="literal">> (timestamp,timestamp)</code></td></tr><tr><td><code class="literal">>= (timestamp,timestamp)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">timestamp_minmax_multi_ops</code></td><td><code class="literal">= (timestamp,timestamp)</code></td></tr><tr><td><code class="literal">< (timestamp,timestamp)</code></td></tr><tr><td><code class="literal"><= (timestamp,timestamp)</code></td></tr><tr><td><code class="literal">> (timestamp,timestamp)</code></td></tr><tr><td><code class="literal">>= (timestamp,timestamp)</code></td></tr><tr><td valign="middle"><code class="literal">timestamptz_bloom_ops</code></td><td><code class="literal">= (timestamptz,timestamptz)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">timestamptz_minmax_ops</code></td><td><code class="literal">= (timestamptz,timestamptz)</code></td></tr><tr><td><code class="literal">< (timestamptz,timestamptz)</code></td></tr><tr><td><code class="literal"><= (timestamptz,timestamptz)</code></td></tr><tr><td><code class="literal">> (timestamptz,timestamptz)</code></td></tr><tr><td><code class="literal">>= (timestamptz,timestamptz)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">timestamptz_minmax_multi_ops</code></td><td><code class="literal">= (timestamptz,timestamptz)</code></td></tr><tr><td><code class="literal">< (timestamptz,timestamptz)</code></td></tr><tr><td><code class="literal"><= (timestamptz,timestamptz)</code></td></tr><tr><td><code class="literal">> (timestamptz,timestamptz)</code></td></tr><tr><td><code class="literal">>= (timestamptz,timestamptz)</code></td></tr><tr><td valign="middle"><code class="literal">time_bloom_ops</code></td><td><code class="literal">= (time,time)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">time_minmax_ops</code></td><td><code class="literal">= (time,time)</code></td></tr><tr><td><code class="literal">< (time,time)</code></td></tr><tr><td><code class="literal"><= (time,time)</code></td></tr><tr><td><code class="literal">> (time,time)</code></td></tr><tr><td><code class="literal">>= (time,time)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">time_minmax_multi_ops</code></td><td><code class="literal">= (time,time)</code></td></tr><tr><td><code class="literal">< (time,time)</code></td></tr><tr><td><code class="literal"><= (time,time)</code></td></tr><tr><td><code class="literal">> (time,time)</code></td></tr><tr><td><code class="literal">>= (time,time)</code></td></tr><tr><td valign="middle"><code class="literal">timetz_bloom_ops</code></td><td><code class="literal">= (timetz,timetz)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">timetz_minmax_ops</code></td><td><code class="literal">= (timetz,timetz)</code></td></tr><tr><td><code class="literal">< (timetz,timetz)</code></td></tr><tr><td><code class="literal"><= (timetz,timetz)</code></td></tr><tr><td><code class="literal">> (timetz,timetz)</code></td></tr><tr><td><code class="literal">>= (timetz,timetz)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">timetz_minmax_multi_ops</code></td><td><code class="literal">= (timetz,timetz)</code></td></tr><tr><td><code class="literal">< (timetz,timetz)</code></td></tr><tr><td><code class="literal"><= (timetz,timetz)</code></td></tr><tr><td><code class="literal">> (timetz,timetz)</code></td></tr><tr><td><code class="literal">>= (timetz,timetz)</code></td></tr><tr><td valign="middle"><code class="literal">uuid_bloom_ops</code></td><td><code class="literal">= (uuid,uuid)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">uuid_minmax_ops</code></td><td><code class="literal">= (uuid,uuid)</code></td></tr><tr><td><code class="literal">< (uuid,uuid)</code></td></tr><tr><td><code class="literal">> (uuid,uuid)</code></td></tr><tr><td><code class="literal"><= (uuid,uuid)</code></td></tr><tr><td><code class="literal">>= (uuid,uuid)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">uuid_minmax_multi_ops</code></td><td><code class="literal">= (uuid,uuid)</code></td></tr><tr><td><code class="literal">< (uuid,uuid)</code></td></tr><tr><td><code class="literal">> (uuid,uuid)</code></td></tr><tr><td><code class="literal"><= (uuid,uuid)</code></td></tr><tr><td><code class="literal">>= (uuid,uuid)</code></td></tr><tr><td rowspan="5" valign="middle"><code class="literal">varbit_minmax_ops</code></td><td><code class="literal">= (varbit,varbit)</code></td></tr><tr><td><code class="literal">< (varbit,varbit)</code></td></tr><tr><td><code class="literal">> (varbit,varbit)</code></td></tr><tr><td><code class="literal"><= (varbit,varbit)</code></td></tr><tr><td><code class="literal">>= (varbit,varbit)</code></td></tr></tbody></table></div></div><br class="table-break" /><div class="sect3" id="BRIN-BUILTIN-OPCLASSES--PARAMETERS"><div class="titlepage"><div><div><h4 class="title">65.5.2.1. 演算子クラスパラメータ <a href="#BRIN-BUILTIN-OPCLASSES--PARAMETERS" class="id_link">#</a></h4></div></div></div><span class="original">
<title>Operator Class Parameters</title>
</span><p>
<span class="original">
Some of the built-in operator classes allow specifying parameters affecting
behavior of the operator class. Each operator class has its own set of
allowed parameters. Only the <literal>bloom</literal> and <literal>minmax-multi</literal>
operator classes allow specifying parameters:
</span>
いくつかの組み込み演算子クラスは演算子クラスの振舞いに影響するパラメータを指定できます。
それぞれの演算子クラスで、指定できる独自のパラメータ群があります。
<code class="literal">bloom</code>演算子クラスと<code class="literal">minmax-multi</code>演算子クラスのみ特定のパラメータが指定できます。
</p><p>
<span class="original">
bloom operator classes accept these parameters:
</span>
bloom演算子クラスでは次のパラメータを受け取ります。
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">n_distinct_per_range</code></span></dt><dd><p>
<span class="original">
Defines the estimated number of distinct non-null values in the block
range, used by <acronym>BRIN</acronym> bloom indexes for sizing of the
Bloom filter. It behaves similarly to <literal>n_distinct</literal> option
for <xref linkend="sql-altertable"/>. When set to a positive value,
each block range is assumed to contain this number of distinct non-null
values. When set to a negative value, which must be greater than or
equal to -1, the number of distinct non-null values is assumed to grow linearly with
the maximum possible number of tuples in the block range (about 290
rows per block). The default value is <literal>-0.1</literal>, and
the minimum number of distinct non-null values is <literal>16</literal>.
</span>
<acronym class="acronym">BRIN</acronym>ブルームインデックスでブルームフィルタのサイズ設定に使用される、ブロックレンジ内の重複しない非NULL値の推定数を定義します。
これは、<a class="xref" href="sql-altertable.html" title="ALTER TABLE"><span class="refentrytitle">ALTER TABLE</span></a>の<code class="literal">n_distinct</code>オプションと同様に動作します。
正の値に設定された場合、各ブロックレンジにはこの数の重複しない非NULL値が含まれているとみなされます。
負の値に設定された場合、重複しない非NULL値の数はブロックレンジ内でのタプルの最大数(ブロックあたり約290行)に比例して増加するとみなされ、-1以上である必要があります。
デフォルト値は<code class="literal">-0.1</code>で、重複しない非NULL値の最小数は<code class="literal">16</code>です。
</p></dd><dt><span class="term"><code class="literal">false_positive_rate</code></span></dt><dd><p>
<span class="original">
Defines the desired false positive rate used by <acronym>BRIN</acronym>
bloom indexes for sizing of the Bloom filter. The values must be
between 0.0001 and 0.25. The default value is 0.01, which is 1% false
positive rate.
</span>
ブルームフィルタのサイズ設定のために<acronym class="acronym">BRIN</acronym>ブルームインデックスによって使用される、必要な偽陽性率を定義します。
値は0.0001から0.25の間でなければなりません。デフォルト値は0.01で、これは1%の偽陽性率です。
</p></dd></dl></div><p>
<span class="original">
minmax-multi operator classes accept these parameters:
</span>
minmax-multi演算子クラスでは次のパラメータを受け取ります。
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">values_per_range</code></span></dt><dd><p>
<span class="original">
Defines the maximum number of values stored by <acronym>BRIN</acronym>
minmax indexes to summarize a block range. Each value may represent
either a point, or a boundary of an interval. Values must be between
8 and 256, and the default value is 32.
</span>
ブロック範囲を集計するために<acronym class="acronym">BRIN</acronym> minmaxインデックスによって格納される値の最大数を定義します。
各値は、点または区間の境界として表すこともできます。値は8から256の間である必要があり、デフォルト値は32です。
</p></dd></dl></div></div></div><div class="sect2" id="BRIN-EXTENSIBILITY"><div class="titlepage"><div><div><h3 class="title">65.5.3. 拡張性 <a href="#BRIN-EXTENSIBILITY" class="id_link">#</a></h3></div></div></div><span class="original">
<title>Extensibility</title>
</span><p>
<span class="original">
The <acronym>BRIN</acronym> interface has a high level of abstraction,
requiring the access method implementer only to implement the semantics
of the data type being accessed. The <acronym>BRIN</acronym> layer
itself takes care of concurrency, logging and searching the index structure.
</span>
<acronym class="acronym">BRIN</acronym>のインタフェースは高度に抽象化されており、アクセスメソッドを実装する人は、アクセスされるデータ型のセマンティクスを実装するだけで良いようになっています。
<acronym class="acronym">BRIN</acronym>層は、同時実行性、ログ、インデックス構造の検索を担当します。
</p><p>
<span class="original">
All it takes to get a <acronym>BRIN</acronym> access method working is to
implement a few user-defined methods, which define the behavior of
summary values stored in the index and the way they interact with
scan keys.
In short, <acronym>BRIN</acronym> combines
extensibility with generality, code reuse, and a clean interface.
</span>
<acronym class="acronym">BRIN</acronym>アクセスメソッドを動作させるために必要なのは、インデックスに格納された要約値の振る舞いと、それらがインデックススキャンする際にどう関係するのかを定義する少数のメソッドを実装することだけです。
つまり、<acronym class="acronym">BRIN</acronym>は一般性、コードの再利用性、整理されたインタフェースと拡張性を同時に実現しています。
</p><p>
<span class="original">
There are four methods that an operator class for <acronym>BRIN</acronym>
must provide:
</span>
<acronym class="acronym">BRIN</acronym>用の演算子クラスは、4つのメソッドを提供する必要があります。
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="function">BrinOpcInfo *opcInfo(Oid type_oid)</code></span></dt><dd><p>
<span class="original">
Returns internal information about the indexed columns' summary data.
The return value must point to a palloc'd <structname>BrinOpcInfo</structname>,
which has this definition:
</span>
インデックスが貼られた列の要約データに関する内部情報を返します。
返却値はpallocされた<code class="structname">BrinOpcInfo</code>へのポインタでなければなりません。
BrinOpcInfoは以下の定義を持ちます。
</p><pre class="programlisting">
typedef struct BrinOpcInfo
{
/* Number of columns stored in an index column of this opclass */
uint16 oi_nstored;
/* Opaque pointer for the opclass' private use */
void *oi_opaque;
/* Type cache entries of the stored columns */
TypeCacheEntry *oi_typcache[FLEXIBLE_ARRAY_MEMBER];
} BrinOpcInfo;
</pre><p>
<span class="original">
<structname>BrinOpcInfo</structname>.<structfield>oi_opaque</structfield> can be used by the
operator class routines to pass information between support functions
during an index scan.
</span>
<code class="structname">BrinOpcInfo</code>.<code class="structfield">oi_opaque</code>は、演算子クラスのルーチンが、インデックススキャン中にサポート関数同士で情報のやり取りをするために使うことができます。
</p></dd><dt><span class="term"><code class="function">bool consistent(BrinDesc *bdesc, BrinValues *column,
ScanKey *keys, int nkeys)</code></span></dt><dd><p>
<span class="original">
Returns whether all the ScanKey entries are consistent with the given
indexed values for a range.
The attribute number to use is passed as part of the scan key.
Multiple scan keys for the same attribute may be passed at once; the
number of entries is determined by the <literal>nkeys</literal> parameter.
</span>
ある範囲について、すべてのScanKeyエントリが指定されたインデックス値と一致するかどうかを返します。
使用する属性の数はスキャンキーの一部として渡されます。
同じ属性の複数のスキャンキーを一度に渡すこともできます。
エントリの数は<code class="literal">nkeys</code>パラメータによって決定されます。
</p></dd><dt><span class="term"><code class="function">bool consistent(BrinDesc *bdesc, BrinValues *column,
ScanKey key)</code></span></dt><dd><p>
<span class="original">
Returns whether the ScanKey is consistent with the given indexed
values for a range.
The attribute number to use is passed as part of the scan key.
This is an older backward-compatible variant of the consistent function.
</span>
ScanKeyがある範囲のインデックス値と一致しているかどうかを返します。
属性の数はスキャンキーの一部として渡されます。
これはconsistent関数の古い後方互換のための派生型です。
</p></dd><dt><span class="term"><code class="function">bool addValue(BrinDesc *bdesc, BrinValues *column,
Datum newval, bool isnull)</code></span></dt><dd><p>
<span class="original">
Given an index tuple and an indexed value, modifies the indicated
attribute of the tuple so that it additionally represents the new value.
If any modification was done to the tuple, <literal>true</literal> is
returned.
</span>
追加された新しい値をインデックスが表現できるように、与えられたインデックスタプルとインデックス値にしたがい、タプルの指定アトリビュートを変更します。
タプルの更新が行われれば、<code class="literal">true</code>が返却されます。
</p></dd><dt><span class="term"><code class="function">bool unionTuples(BrinDesc *bdesc, BrinValues *a,
BrinValues *b)</code></span></dt><dd><p>
<span class="original">
Consolidates two index tuples. Given two index tuples, modifies the
indicated attribute of the first of them so that it represents both tuples.
The second tuple is not modified.
</span>
2つのインデックスタプルを統合します。
与えられた2つのインデックスタプルのうち、最初のインデックスタプルを変更して、両方のタプルを表現できるようにします。
2番目のタプルは変更されません。
</p></dd></dl></div><p>
<span class="original">
An operator class for <acronym>BRIN</acronym> can optionally specify the
following method:
</span>
省略可能ですが、<acronym class="acronym">BRIN</acronym>に対する演算子クラスは以下のメソッドを指定できます。
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="function">void options(local_relopts *relopts)</code></span></dt><dd><p>
<span class="original">
Defines a set of user-visible parameters that control operator class
behavior.
</span>
演算子クラスの振舞いを制御するユーザに可視のパラメータの集合を定義します。
</p><p>
<span class="original">
The <function>options</function> function is passed a pointer to a
<structname>local_relopts</structname> struct, which needs to be
filled with a set of operator class specific options. The options
can be accessed from other support functions using the
<literal>PG_HAS_OPCLASS_OPTIONS()</literal> and
<literal>PG_GET_OPCLASS_OPTIONS()</literal> macros.
</span>
<code class="function">options</code>関数には<code class="structname">local_relopts</code>構造体へのポインタが渡されますが、構造体を演算子クラスに固有のオプションの集合で満たすことが必要です。
オプションはマクロ<code class="literal">PG_HAS_OPCLASS_OPTIONS()</code>と<code class="literal">PG_GET_OPCLASS_OPTIONS()</code>を使って他のサポート関数からアクセスできます。
</p><p>
<span class="original">
Since both key extraction of indexed values and representation of the
key in <acronym>BRIN</acronym> are flexible, they may depend on
user-specified parameters.
</span>
インデックス付けされた値からのキーの抽出にも<acronym class="acronym">BRIN</acronym>でのキーの表現にも柔軟性がありますので、ユーザに固有のパラメータに依存するかもしれません。
</p></dd></dl></div><p>
<span class="original">
The core distribution includes support for four types of operator classes:
minmax, minmax-multi, inclusion and bloom. Operator class definitions
using them are shipped for in-core data types as appropriate. Additional
operator classes can be defined by the user for other data types using
equivalent definitions, without having to write any source code;
appropriate catalog entries being declared is enough. Note that
assumptions about the semantics of operator strategies are embedded in the
support functions' source code.
</span>
コア配布物には、4種類の演算子クラスが含まれます。すなわち、minmax、inclusion、minmax-multiとbloomです。
それらを使った演算子クラスの定義がコア配布物に必要に応じて含まれます。
同じ定義を使って、ユーザは他のデータ型のために演算子クラスを定義することができます。
そのためにソースコードを書く必要はありません。適切なシステムカタログの定義があれば十分です。
演算子ストラテジのセマンティクスは、サポート関数のソースコード中に埋め込まれていることに注意してください。
</p><p>
<span class="original">
Operator classes that implement completely different semantics are also
possible, provided implementations of the four main support functions
described above are written. Note that backwards compatibility across major
releases is not guaranteed: for example, additional support functions might
be required in later releases.
</span>
前述の4つの主要なサポート関数を実装することにより、まったく異なるセマンティクスを実装する演算子クラスも可能です。
なお、メジャーリリース間では下位互換性は保証されていません。
たとえば、新しいリリースでは、サポート関数が追加で必要になるかもしれません。
</p><p>
<span class="original">
To write an operator class for a data type that implements a totally
ordered set, it is possible to use the minmax support functions
alongside the corresponding operators, as shown in
<xref linkend="brin-extensibility-minmax-table"/>.
All operator class members (functions and operators) are mandatory.
</span>
<a class="xref" href="brin.html#BRIN-EXTENSIBILITY-MINMAX-TABLE" title="表65.5 Minmax演算子クラスの関数とサポート番号">表 65.5</a>で示すように、全順序集合を実装するデータ型のための演算子クラスを書くために、関連する演算子とともにminmaxサポート関数を使うことができます。
演算子クラスのメンバ(関数と演算子)はすべて必須です。
</p><div class="table" id="BRIN-EXTENSIBILITY-MINMAX-TABLE"><p class="title"><strong>表65.5 Minmax演算子クラスの関数とサポート番号</strong></p><div class="table-contents"><span class="original">
<title>Function and Support Numbers for Minmax Operator Classes</title>
</span><table class="table" summary="Minmax演算子クラスの関数とサポート番号" border="1"><colgroup><col class="col1" /><col class="col2" /></colgroup><thead><tr><th>演算子クラスメンバ</th><th>オブジェクト</th></tr></thead><tbody><tr><td>サポート関数 1</td><td>内部関数<code class="function">brin_minmax_opcinfo()</code></td></tr><tr><td>サポート関数 2</td><td>内部関数<code class="function">brin_minmax_add_value()</code></td></tr><tr><td>サポート関数 3</td><td>内部関数<code class="function">brin_minmax_consistent()</code></td></tr><tr><td>サポート関数 4</td><td>内部関数<code class="function">brin_minmax_union()</code></td></tr><tr><td>Operator Strategy 1</td><td>operator less-than</td></tr><tr><td>Operator Strategy 2</td><td>operator less-than-or-equal-to</td></tr><tr><td>Operator Strategy 3</td><td>operator equal-to</td></tr><tr><td>Operator Strategy 4</td><td>operator greater-than-or-equal-to</td></tr><tr><td>Operator Strategy 5</td><td>operator greater-than</td></tr></tbody></table></div></div><br class="table-break" /><p>
<span class="original">
To write an operator class for a complex data type which has values
included within another type, it's possible to use the inclusion support
functions alongside the corresponding operators, as shown
in <xref linkend="brin-extensibility-inclusion-table"/>. It requires
only a single additional function, which can be written in any language.
More functions can be defined for additional functionality. All operators
are optional. Some operators require other operators, as shown as
dependencies on the table.
</span>
<a class="xref" href="brin.html#BRIN-EXTENSIBILITY-INCLUSION-TABLE" title="表65.6 Inclusion演算子クラスの関数とサポート番号">表 65.6</a>で示すように、他のデータ型の値を含む複合データ型の演算子クラスを書くには、関連する演算子とともに、inclusionサポート関数を使うことができます。
任意の言語で書かれたたったひとつの関数を追加するだけです。
機能を追加するために関数を追加できます。
すべての演算子はオプションです。
表の中依存性の項目で示されているように、ある種の演算子は他の演算子を必要とすることもあります。
</p><div class="table" id="BRIN-EXTENSIBILITY-INCLUSION-TABLE"><p class="title"><strong>表65.6 Inclusion演算子クラスの関数とサポート番号</strong></p><div class="table-contents"><span class="original">
<title>Function and Support Numbers for Inclusion Operator Classes</title>
</span><table class="table" summary="Inclusion演算子クラスの関数とサポート番号" border="1"><colgroup><col class="col1" /><col class="col2" /><col class="col3" /></colgroup><thead><tr><th>演算子クラスメンバ</th><th>オブジェクト</th><th>依存性</th></tr></thead><tbody><tr><td>サポート関数 1</td><td>内部関数<code class="function">brin_inclusion_opcinfo()</code></td><td> </td></tr><tr><td>サポート関数 2</td><td>内部関数<code class="function">brin_inclusion_add_value()</code></td><td> </td></tr><tr><td>サポート関数 3</td><td>内部関数<code class="function">brin_inclusion_consistent()</code></td><td> </td></tr><tr><td>サポート関数 4</td><td>内部関数<code class="function">brin_inclusion_union()</code></td><td> </td></tr><tr><td>サポート関数 11</td><td>2つの要素をマージする関数</td><td> </td></tr><tr><td>サポート関数 12</td><td>2つの要素がマージ可能かどうか確認するオプションの関数</td><td> </td></tr><tr><td>サポート関数 13</td><td>要素が他の要素に含まれるかどうかを確認するオプションの関数</td><td> </td></tr><tr><td>サポート関数 14</td><td>要素が空かどうかを確認するオプションの関数</td><td> </td></tr><tr><td>Operator Strategy 1</td><td>operator left-of</td><td>Operator Strategy 4</td></tr><tr><td>Operator Strategy 2</td><td>operator does-not-extend-to-the-right-of</td><td>Operator Strategy 5</td></tr><tr><td>Operator Strategy 3</td><td>operator overlaps</td><td> </td></tr><tr><td>Operator Strategy 4</td><td>operator does-not-extend-to-the-left-of</td><td>Operator Strategy 1</td></tr><tr><td>Operator Strategy 5</td><td>operator right-of</td><td>Operator Strategy 2</td></tr><tr><td>Operator Strategy 6, 18</td><td>operator same-as-or-equal-to</td><td>Operator Strategy 7</td></tr><tr><td>Operator Strategy 7, 16, 24, 25</td><td>operator contains-or-equal-to</td><td> </td></tr><tr><td>Operator Strategy 8, 26, 27</td><td>operator is-contained-by-or-equal-to</td><td>Operator Strategy 3</td></tr><tr><td>Operator Strategy 9</td><td>operator does-not-extend-above</td><td>Operator Strategy 11</td></tr><tr><td>Operator Strategy 10</td><td>operator is-below</td><td>Operator Strategy 12</td></tr><tr><td>Operator Strategy 11</td><td>operator is-above</td><td>Operator Strategy 9</td></tr><tr><td>Operator Strategy 12</td><td>operator does-not-extend-below</td><td>Operator Strategy 10</td></tr><tr><td>Operator Strategy 20</td><td>operator less-than</td><td>Operator Strategy 5</td></tr><tr><td>Operator Strategy 21</td><td>operator less-than-or-equal-to</td><td>Operator Strategy 5</td></tr><tr><td>Operator Strategy 22</td><td>operator greater-than</td><td>Operator Strategy 1</td></tr><tr><td>Operator Strategy 23</td><td>operator greater-than-or-equal-to</td><td>Operator Strategy 1</td></tr></tbody></table></div></div><br class="table-break" /><p>
<span class="original">
Support function numbers 1 through 10 are reserved for the BRIN internal
functions, so the SQL level functions start with number 11. Support
function number 11 is the main function required to build the index.
It should accept two arguments with the same data type as the operator class,
and return the union of them. The inclusion operator class can store union
values with different data types if it is defined with the
<literal>STORAGE</literal> parameter. The return value of the union
function should match the <literal>STORAGE</literal> data type.
</span>
サポート関数番号1から10は、BRINの内部関数用に予約されており、SQLレベルの関数は番号11から始まります。
サポート関数11は、インデックスを構築するのに必要なメイン関数です。
その関数は演算子クラスと同じデータ型を持つ2つの引数を受け取り、それらの和を返します。
もし<code class="literal">STORAGE</code>パラメータで定義されていれば、inclusion 演算子クラスは異なるデータ型の和を格納できます。
和関数の戻り値は、<code class="literal">STORAGE</code>データ型と一致していなければなりません。
</p><p>
<span class="original">
Support function numbers 12 and 14 are provided to support
irregularities of built-in data types. Function number 12
is used to support network addresses from different families which
are not mergeable. Function number 14 is used to support
empty ranges. Function number 13 is an optional but
recommended one, which allows the new value to be checked before
it is passed to the union function. As the BRIN framework can shortcut
some operations when the union is not changed, using this
function can improve index performance.
</span>
サポート関数番号12と14は、組み込みデータ型の例外事象をサポートするために提供されます。
サポート関数番号12は、マージできない異なるファミリーのネットワークアドレスをサポートするために使用されます。
サポート関数番号14は、空のレンジをサポートするために使用されます。
サポート関数番号13はオプションですが、和関数に渡される前に新しい値のチェックを行うためのものとして推奨されます。
BRINフレームワークは和が変化しない時に操作を省略することができるため、この関数を使うことによってインデックスの性能が向上する可能性があります。
</p><p>
<span class="original">
To write an operator class for a data type that implements only an equality
operator and supports hashing, it is possible to use the bloom support procedures
alongside the corresponding operators, as shown in
<xref linkend="brin-extensibility-bloom-table"/>.
All operator class members (procedures and operators) are mandatory.
</span>
<a class="xref" href="brin.html#BRIN-EXTENSIBILITY-BLOOM-TABLE" title="表65.7 Bloom演算子クラスのプロシージャとサポート番号">表 65.7</a>で示すように、等号演算子のみを実装しハッシュをサポートするデータ型の演算子クラスを書くために、関連する演算子とともにbloomがサポートするプロシージャを使うことができます。
演算子クラスのメンバ(プロシージャと演算子)はすべて必須です。
</p><div class="table" id="BRIN-EXTENSIBILITY-BLOOM-TABLE"><p class="title"><strong>表65.7 Bloom演算子クラスのプロシージャとサポート番号</strong></p><div class="table-contents"><span class="original">
<title>Procedure and Support Numbers for Bloom Operator Classes</title>
</span><table class="table" summary="Bloom演算子クラスのプロシージャとサポート番号" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>演算子クラスメンバ</th><th>オブジェクト</th></tr></thead><tbody><tr><td>サポートプロシージャ 1</td><td>内部関数<code class="function">brin_bloom_opcinfo()</code></td></tr><tr><td>サポートプロシージャ 2</td><td>内部関数<code class="function">brin_bloom_add_value()</code></td></tr><tr><td>サポートプロシージャ 3</td><td>内部関数<code class="function">brin_bloom_consistent()</code></td></tr><tr><td>サポートプロシージャ 4</td><td>内部関数<code class="function">brin_bloom_union()</code></td></tr><tr><td>サポートプロシージャ 5</td><td>内部関数<code class="function">brin_bloom_options()</code></td></tr><tr><td>サポートプロシージャ 11</td><td>要素のハッシュを計算する関数</td></tr><tr><td>Operator Strategy 1</td><td>operator equal-to</td></tr></tbody></table></div></div><br class="table-break" /><p>
<span class="original">
Support procedure numbers 1-10 are reserved for the BRIN internal
functions, so the SQL level functions start with number 11. Support
function number 11 is the main function required to build the index.
It should accept one argument with the same data type as the operator class,
and return a hash of the value.
</span>
サポートプロシージャ番号1から10は、BRINの内部関数として予約されており、SQLレベルの関数は11番から始まります。
サポート関数11は、インデックスを構築するのに必要なメイン関数です。
演算子クラスと同じデータ型の引数を1つ受け取り、その値のハッシュを返す必要があります。
</p><p>
<span class="original">
The minmax-multi operator class is also intended for data types implementing
a totally ordered set, and may be seen as a simple extension of the minmax
operator class. While minmax operator class summarizes values from each block
range into a single contiguous interval, minmax-multi allows summarization
into multiple smaller intervals to improve handling of outlier values.
It is possible to use the minmax-multi support procedures alongside the
corresponding operators, as shown in
<xref linkend="brin-extensibility-minmax-multi-table"/>.
All operator class members (procedures and operators) are mandatory.
</span>
minmax-multi演算子クラスもまた、全順序集合を実装するデータ型を対象としており、minmax演算子クラスの単純な拡張と見なすことができます。
minmax演算子クラスは各ブロックの範囲を一つの連続した区間にまとめますが、minmax-multiはより小さな複数の区間にまとめることで、外れ値の扱いを改善します。
<a class="xref" href="brin.html#BRIN-EXTENSIBILITY-MINMAX-MULTI-TABLE" title="表65.8 minmax-multi演算子クラスのプロシージャとサポート番号">表 65.8</a>で示すように、関連する演算子とともにminmax-multiがサポートするプロシージャを使うことができます。
演算子クラスのメンバ(プロシージャと演算子)はすべて必須です。
</p><div class="table" id="BRIN-EXTENSIBILITY-MINMAX-MULTI-TABLE"><p class="title"><strong>表65.8 minmax-multi演算子クラスのプロシージャとサポート番号</strong></p><div class="table-contents"><span class="original">
<title>Procedure and Support Numbers for minmax-multi Operator Classes</title>
</span><table class="table" summary="minmax-multi演算子クラスのプロシージャとサポート番号" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>演算子クラスメンバ</th><th>オブジェクト</th></tr></thead><tbody><tr><td>サポートプロシージャ 1</td><td>内部関数<code class="function">brin_minmax_multi_opcinfo()</code></td></tr><tr><td>サポートプロシージャ 2</td><td>内部関数<code class="function">brin_minmax_multi_add_value()</code></td></tr><tr><td>サポートプロシージャ 3</td><td>内部関数<code class="function">brin_minmax_multi_consistent()</code></td></tr><tr><td>サポートプロシージャ 4</td><td>内部関数<code class="function">brin_minmax_multi_union()</code></td></tr><tr><td>サポートプロシージャ 5</td><td>内部関数<code class="function">brin_minmax_multi_options()</code></td></tr><tr><td>サポートプロシージャ 11</td><td>2つの値の間の距離(範囲の長さ)を計算する関数</td></tr><tr><td>Operator Strategy 1</td><td>operator less-than</td></tr><tr><td>Operator Strategy 2</td><td>operator less-than-or-equal-to</td></tr><tr><td>Operator Strategy 3</td><td>operator equal-to</td></tr><tr><td>Operator Strategy 4</td><td>operator greater-than-or-equal-to</td></tr><tr><td>Operator Strategy 5</td><td>operator greater-than</td></tr></tbody></table></div></div><br class="table-break" /><p>
<span class="original">
Both minmax and inclusion operator classes support cross-data-type
operators, though with these the dependencies become more complicated.
The minmax operator class requires a full set of operators to be
defined with both arguments having the same data type. It allows
additional data types to be supported by defining extra sets
of operators. Inclusion operator class operator strategies are dependent
on another operator strategy as shown in
<xref linkend="brin-extensibility-inclusion-table"/>, or the same
operator strategy as themselves. They require the dependency
operator to be defined with the <literal>STORAGE</literal> data type as the
left-hand-side argument and the other supported data type to be the
right-hand-side argument of the supported operator. See
<literal>float4_minmax_ops</literal> as an example of minmax, and
<literal>box_inclusion_ops</literal> as an example of inclusion.
</span>
minmaxとinclusion演算子クラスは、データ型をまたがる演算子をサポートします。
しかし、これらを使用すると依存関係はより複雑になります。
minmax演算子クラスは、両方の引数がデータ型が同じ型である完全な演算子のセットが必要になります。
追加の演算子の組を定義することにより、追加のデータ型をサポートすることができます。
<a class="xref" href="brin.html#BRIN-EXTENSIBILITY-INCLUSION-TABLE" title="表65.6 Inclusion演算子クラスの関数とサポート番号">表 65.6</a>で示すように、inclusion演算子クラスのストラテジは、他の演算子クラスのストラテジに依存するか、自分自身の演算子クラスのストラテジに依存します。
演算子クラスは、依存演算子が<code class="literal">STORAGE</code>データ型とともにサポートするデータ型の左辺引数、他のサポートするデータ型をサポートする演算子の右辺引数として定義される必要があります。
minmaxの例として<code class="literal">float4_minmax_ops</code>、inclusionの例として<code class="literal">box_inclusion_ops</code>を参照してください。
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="gin.html" title="65.4. GINインデックス">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="indextypes.html" title="第65章 組み込みインデックスアクセスメソッド">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="hash-index.html" title="65.6. ハッシュインデックス">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">65.4. GINインデックス </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.3文書">ホーム</a></td><td width="40%" align="right" valign="top"> 65.6. ハッシュインデックス</td></tr></table></div></body></html>