1 <!-- doc/src/sgml/btree-gin.sgml -->
3 <sect1 id="btree-gin" xreflabel="btree_gin">
4 <title>btree_gin</title>
6 <indexterm zone="btree-gin">
7 <primary>btree_gin</primary>
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.
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.
35 <title>Example Usage</title>
38 CREATE TABLE test (a int4);
40 CREATE INDEX testidx ON test USING GIN (a);
42 SELECT * FROM test WHERE a < 10;
48 <title>Authors</title>
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.