]> granicus.if.org Git - postgresql/blob - doc/src/sgml/btree-gin.sgml
Trim trailing whitespace
[postgresql] / doc / src / sgml / btree-gin.sgml
1 <!-- doc/src/sgml/btree-gin.sgml -->
2
3 <sect1 id="btree-gin" xreflabel="btree_gin">
4  <title>btree_gin</title>
5
6  <indexterm zone="btree-gin">
7   <primary>btree_gin</primary>
8  </indexterm>
9
10  <para>
11   <filename>btree_gin</> provides sample GIN operator classes that
12   implement B-tree equivalent behavior for the data types
13   <type>int2</>, <type>int4</>, <type>int8</>, <type>float4</>,
14   <type>float8</>, <type>timestamp with time zone</>,
15   <type>timestamp without time zone</>, <type>time with time zone</>,
16   <type>time without time zone</>, <type>date</>, <type>interval</>,
17   <type>oid</>, <type>money</>, <type>"char"</>,
18   <type>varchar</>, <type>text</>, <type>bytea</>, <type>bit</>,
19   <type>varbit</>, <type>macaddr</>, <type>macaddr8</>, <type>inet</>,
20   <type>cidr</>, and all <type>enum</> types.
21  </para>
22
23  <para>
24   In general, these operator classes will not outperform the equivalent
25   standard B-tree index methods, and they lack one major feature of the
26   standard B-tree code: the ability to enforce uniqueness.  However,
27   they are useful for GIN testing and as a base for developing other
28   GIN operator classes.  Also, for queries that test both a GIN-indexable
29   column and a B-tree-indexable column, it might be more efficient to create
30   a multicolumn GIN index that uses one of these operator classes than to create
31   two separate indexes that would have to be combined via bitmap ANDing.
32  </para>
33
34  <sect2>
35   <title>Example Usage</title>
36
37 <programlisting>
38 CREATE TABLE test (a int4);
39 -- create index
40 CREATE INDEX testidx ON test USING GIN (a);
41 -- query
42 SELECT * FROM test WHERE a &lt; 10;
43 </programlisting>
44
45  </sect2>
46
47  <sect2>
48   <title>Authors</title>
49
50   <para>
51    Teodor Sigaev (<email>teodor@stack.net</email>) and
52    Oleg Bartunov (<email>oleg@sai.msu.su</email>).  See
53    <ulink url="http://www.sai.msu.su/~megera/oddmuse/index.cgi/Gin"></ulink>
54    for additional information.
55   </para>
56
57  </sect2>
58
59 </sect1>