codekingpro/portable-devtools
115k
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>70.1. Introduction</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="Chapter 70. GIN Indexes" /><link rel="next" href="gin-builtin-opclasses.html" title="70.2. Built-in Operator Classes" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">70.1. Introduction</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="gin.html" title="Chapter 70. GIN Indexes">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="gin.html" title="Chapter 70. GIN Indexes">Up</a></td><th width="60%" align="center">Chapter 70. GIN Indexes</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="gin-builtin-opclasses.html" title="70.2. Built-in Operator Classes">Next</a></td></tr></table><hr /></div><div class="sect1" id="GIN-INTRO"><div class="titlepage"><div><div><h2 class="title" style="clear: both">70.1. Introduction <a href="#GIN-INTRO" class="id_link">#</a></h2></div></div></div><p>3 <acronym class="acronym">GIN</acronym> stands for Generalized Inverted Index.4 <acronym class="acronym">GIN</acronym> is designed for handling cases where the items5 to be indexed are composite values, and the queries to be handled by6 the index need to search for element values that appear within7 the composite items. For example, the items could be documents,8 and the queries could be searches for documents containing specific words.9 </p><p>10 We use the word <em class="firstterm">item</em> to refer to a composite value that11 is to be indexed, and the word <em class="firstterm">key</em> to refer to an element12 value. <acronym class="acronym">GIN</acronym> always stores and searches for keys,13 not item values per se.14 </p><p>15 A <acronym class="acronym">GIN</acronym> index stores a set of (key, posting list) pairs,16 where a <em class="firstterm">posting list</em> is a set of row IDs in which the key17 occurs. The same row ID can appear in multiple posting lists, since18 an item can contain more than one key. Each key value is stored only19 once, so a <acronym class="acronym">GIN</acronym> index is very compact for cases20 where the same key appears many times.21 </p><p>22 <acronym class="acronym">GIN</acronym> is generalized in the sense that the23 <acronym class="acronym">GIN</acronym> access method code does not need to know the24 specific operations that it accelerates.25 Instead, it uses custom strategies defined for particular data types.26 The strategy defines how keys are extracted from indexed items and27 query conditions, and how to determine whether a row that contains28 some of the key values in a query actually satisfies the query.29 </p><p>30 One advantage of <acronym class="acronym">GIN</acronym> is that it allows the development31 of custom data types with the appropriate access methods, by32 an expert in the domain of the data type, rather than a database expert.33 This is much the same advantage as using <acronym class="acronym">GiST</acronym>.34 </p><p>35 The <acronym class="acronym">GIN</acronym>36 implementation in <span class="productname">PostgreSQL</span> is primarily37 maintained by Teodor Sigaev and Oleg Bartunov. There is more38 information about <acronym class="acronym">GIN</acronym> on their39 <a class="ulink" href="http://www.sai.msu.su/~megera/wiki/Gin" target="_top">website</a>.40 </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="gin.html" title="Chapter 70. GIN Indexes">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gin.html" title="Chapter 70. GIN Indexes">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="gin-builtin-opclasses.html" title="70.2. Built-in Operator Classes">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 70. GIN Indexes </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"> 70.2. Built-in Operator Classes</td></tr></table></div></body></html>