codekingpro/portable-devtools
114k
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>2<!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>F.8. btree_gin — GIN operator classes with B-tree behavior</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="bloom.html" title="F.7. bloom — bloom filter index access method" /><link rel="next" href="btree-gist.html" title="F.9. btree_gist — GiST operator classes with B-tree behavior" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">F.8. btree_gin — GIN operator classes with B-tree behavior</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="bloom.html" title="F.7. bloom — bloom filter index access method">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="contrib.html" title="Appendix F. Additional Supplied Modules and Extensions">Up</a></td><th width="60%" align="center">Appendix F. Additional Supplied Modules and Extensions</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="btree-gist.html" title="F.9. btree_gist — GiST operator classes with B-tree behavior">Next</a></td></tr></table><hr /></div><div class="sect1" id="BTREE-GIN"><div class="titlepage"><div><div><h2 class="title" style="clear: both">F.8. btree_gin — GIN operator classes with B-tree behavior <a href="#BTREE-GIN" class="id_link">#</a></h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="btree-gin.html#BTREE-GIN-EXAMPLE-USAGE">F.8.1. Example Usage</a></span></dt><dt><span class="sect2"><a href="btree-gin.html#BTREE-GIN-AUTHORS">F.8.2. Authors</a></span></dt></dl></div><a id="id-1.11.7.18.2" class="indexterm"></a><p>3 <code class="filename">btree_gin</code> provides GIN operator classes that4 implement B-tree equivalent behavior for the data types5 <code class="type">int2</code>, <code class="type">int4</code>, <code class="type">int8</code>, <code class="type">float4</code>,6 <code class="type">float8</code>, <code class="type">timestamp with time zone</code>,7 <code class="type">timestamp without time zone</code>, <code class="type">time with time zone</code>,8 <code class="type">time without time zone</code>, <code class="type">date</code>, <code class="type">interval</code>,9 <code class="type">oid</code>, <code class="type">money</code>, <code class="type">"char"</code>,10 <code class="type">varchar</code>, <code class="type">text</code>, <code class="type">bytea</code>, <code class="type">bit</code>,11 <code class="type">varbit</code>, <code class="type">macaddr</code>, <code class="type">macaddr8</code>, <code class="type">inet</code>,12 <code class="type">cidr</code>, <code class="type">uuid</code>, <code class="type">name</code>, <code class="type">bool</code>,13 <code class="type">bpchar</code>, and all <code class="type">enum</code> types.14 </p><p>15 In general, these operator classes will not outperform the equivalent16 standard B-tree index methods, and they lack one major feature of the17 standard B-tree code: the ability to enforce uniqueness. However,18 they are useful for GIN testing and as a base for developing other19 GIN operator classes. Also, for queries that test both a GIN-indexable20 column and a B-tree-indexable column, it might be more efficient to create21 a multicolumn GIN index that uses one of these operator classes than to create22 two separate indexes that would have to be combined via bitmap ANDing.23 </p><p>24 This module is considered <span class="quote">“<span class="quote">trusted</span>”</span>, that is, it can be25 installed by non-superusers who have <code class="literal">CREATE</code> privilege26 on the current database.27 </p><div class="sect2" id="BTREE-GIN-EXAMPLE-USAGE"><div class="titlepage"><div><div><h3 class="title">F.8.1. Example Usage <a href="#BTREE-GIN-EXAMPLE-USAGE" class="id_link">#</a></h3></div></div></div><pre class="programlisting">28CREATE TABLE test (a int4);29-- create index30CREATE INDEX testidx ON test USING GIN (a);31-- query32SELECT * FROM test WHERE a < 10;33</pre></div><div class="sect2" id="BTREE-GIN-AUTHORS"><div class="titlepage"><div><div><h3 class="title">F.8.2. Authors <a href="#BTREE-GIN-AUTHORS" class="id_link">#</a></h3></div></div></div><p>34 Teodor Sigaev (<code class="email"><<a class="email" href="mailto:teodor@stack.net">teodor@stack.net</a>></code>) and35 Oleg Bartunov (<code class="email"><<a class="email" href="mailto:oleg@sai.msu.su">oleg@sai.msu.su</a>></code>). See36 <a class="ulink" href="http://www.sai.msu.su/~megera/oddmuse/index.cgi/Gin" target="_top">http://www.sai.msu.su/~megera/oddmuse/index.cgi/Gin</a>37 for additional information.38 </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bloom.html" title="F.7. bloom — bloom filter index access method">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="contrib.html" title="Appendix F. Additional Supplied Modules and Extensions">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="btree-gist.html" title="F.9. btree_gist — GiST operator classes with B-tree behavior">Next</a></td></tr><tr><td width="40%" align="left" valign="top">F.7. bloom — bloom filter index access method </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> F.9. btree_gist — GiST operator classes with B-tree behavior</td></tr></table></div></body></html>