Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit19dd2fb

Browse files
committed
Add GIN documentation.
Christopher Kings-Lynne
1 parenta65f7db commit19dd2fb

File tree

3 files changed

+173
-2
lines changed

3 files changed

+173
-2
lines changed

‎doc/src/sgml/filelist.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/filelist.sgml,v 1.44 2005/09/12 22:11:38 neilc Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/filelist.sgml,v 1.45 2006/09/04 20:10:53 momjian Exp $ -->
22

33
<!entity history SYSTEM "history.sgml">
44
<!entity info SYSTEM "info.sgml">
@@ -78,6 +78,7 @@
7878
<!entity catalogs SYSTEM "catalogs.sgml">
7979
<!entity geqo SYSTEM "geqo.sgml">
8080
<!entity gist SYSTEM "gist.sgml">
81+
<!entity gin SYSTEM "gin.sgml">
8182
<!entity planstats SYSTEM "planstats.sgml">
8283
<!entity indexam SYSTEM "indexam.sgml">
8384
<!entity nls SYSTEM "nls.sgml">

‎doc/src/sgml/gin.sgml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/gin.sgml,v 1.1 2006/09/04 20:10:53 momjian Exp $ -->
2+
3+
<chapter id="GIN">
4+
<title>GIN Indexes</title>
5+
6+
<indexterm>
7+
<primary>index</primary>
8+
<secondary>GIN</secondary>
9+
</indexterm>
10+
11+
<sect1 id="gin-intro">
12+
<title>Introduction</title>
13+
14+
<para>
15+
<acronym>GIN</acronym> stands for Generalized Inverted Index. It is
16+
an index structure storing a set of (key, posting list) pairs, where
17+
'posting list' is a set of documents in which the key occurs.
18+
</para>
19+
20+
<para>
21+
It is generalized in the sense that a <acronym>GIN</acronym> index
22+
does not need to be aware of the operation that it accelerates.
23+
Instead, it uses custom strategies defined for particular data types.
24+
</para>
25+
26+
<para>
27+
One advantage of <acronym>GIN</acronym> is that it allows the development
28+
of custom data types with the appropriate access methods, by
29+
an expert in the domain of the data type, rather than a database expert.
30+
This is much the same advantage as using <acronym>GiST</acronym>.
31+
</para>
32+
33+
<para>
34+
The <acronym>GIN</acronym>
35+
implementation in <productname>PostgreSQL</productname> is primarily
36+
maintained by Teodor Sigaev and Oleg Bartunov, and there is more
37+
information on their
38+
<ulink url="http://www.sai.msu.su/~megera/oddmuse/index.cgi/Gin">website</ulink>.
39+
</para>
40+
41+
</sect1>
42+
43+
<sect1 id="gin-extensibility">
44+
<title>Extensibility</title>
45+
46+
<para>
47+
The <acronym>GIN</acronym> interface has a high level of abstraction,
48+
requiring the access method implementer to only implement the semantics of
49+
the data type being accessed. The <acronym>GIN</acronym> layer itself
50+
takes care of concurrency, logging and searching the tree structure.
51+
</para>
52+
53+
<para>
54+
All it takes to get a <acronym>GIN</acronym> access method working
55+
is to implement four user-defined methods, which define the behavior of
56+
keys in the tree. In short, <acronym>GIN</acronym> combines extensibility
57+
along with generality, code reuse, and a clean interface.
58+
</para>
59+
60+
</sect1>
61+
62+
<sect1 id="gin-implementation">
63+
<title>Implementation</title>
64+
65+
<para>
66+
There are four methods that an index operator class for
67+
<acronym>GIN</acronym> must provide:
68+
</para>
69+
70+
<variablelist>
71+
<varlistentry>
72+
<term>compare</term>
73+
<listitem>
74+
<para>
75+
</para>
76+
</listitem>
77+
</varlistentry>
78+
79+
<varlistentry>
80+
<term>extract value</term>
81+
<listitem>
82+
<para>
83+
</para>
84+
</listitem>
85+
</varlistentry>
86+
87+
<varlistentry>
88+
<term>extract query</term>
89+
<listitem>
90+
<para>
91+
</para>
92+
</listitem>
93+
</varlistentry>
94+
95+
<varlistentry>
96+
<term>consistent</term>
97+
<listitem>
98+
<para>
99+
</para>
100+
</listitem>
101+
</varlistentry>
102+
103+
</variablelist>
104+
105+
</sect1>
106+
107+
<sect1 id="gin-examples">
108+
<title>Examples</title>
109+
110+
<para>
111+
The <productname>PostgreSQL</productname> source distribution includes
112+
<acronym>GIN</acronym> classes for one-dimensional arrays of all internal
113+
types. The following
114+
<filename>contrib</> modules also contain <acronym>GIN</acronym>
115+
operator classes:
116+
</para>
117+
118+
<variablelist>
119+
<varlistentry>
120+
<term>intarray</term>
121+
<listitem>
122+
<para>Enhanced support for int4[]</para>
123+
</listitem>
124+
</varlistentry>
125+
126+
<varlistentry>
127+
<term>tsearch2</term>
128+
<listitem>
129+
<para>Support for inverted text indexing. This is much faster for very
130+
large, mostly-static sets of documents.
131+
</para>
132+
</listitem>
133+
</varlistentry>
134+
135+
</chapter>

‎doc/src/sgml/xindex.sgml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/xindex.sgml,v 1.43 2006/03/10 19:10:49 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/xindex.sgml,v 1.44 2006/09/04 20:10:53 momjian Exp $ -->
22

33
<sect1 id="xindex">
44
<title>Interfacing Extensions To Indexes</title>
@@ -380,6 +380,41 @@
380380
</tgroup>
381381
</table>
382382

383+
<para>
384+
GIN indexes require four support functions,
385+
shown in <xref linkend="xindex-gin-support-table">.
386+
</para>
387+
388+
<table tocentry="1" id="xindex-gin-support-table">
389+
<title>GIN Support Functions</title>
390+
<tgroup cols="2">
391+
<thead>
392+
<row>
393+
<entry>Function</entry>
394+
<entry>Support Number</entry>
395+
</row>
396+
</thead>
397+
<tbody>
398+
<row>
399+
<entry>compare</entry>
400+
<entry>1</entry>
401+
</row>
402+
<row>
403+
<entry>extract value</entry>
404+
<entry>2</entry>
405+
</row>
406+
<row>
407+
<entry>extract query</entry>
408+
<entry>3</entry>
409+
</row>
410+
<row>
411+
<entry>consistent</entry>
412+
<entry>4</entry>
413+
</row>
414+
</tbody>
415+
</tgroup>
416+
</table>
417+
383418
<para>
384419
Unlike strategy operators, support functions return whichever data
385420
type the particular index method expects; for example in the case

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp