Home Explore Blog CI



postgresql

8th chunk of `doc/src/sgml/xindex.sgml`
01eebf951c83be57dc7a641d9d3722de1e9a25ca826d86a00000000100000fa0
 <entry>6</entry>
      </row>
     </tbody>
    </tgroup>
   </table>

  <para>
   GIN indexes have seven support functions, four of which are optional,
   as shown in <xref linkend="xindex-gin-support-table"/>.
   (For more information see <xref linkend="gin"/>.)
  </para>

   <table tocentry="1" id="xindex-gin-support-table">
    <title>GIN Support Functions</title>
    <tgroup cols="3">
     <colspec colname="col1" colwidth="2*"/>
     <colspec colname="col2" colwidth="3*"/>
     <colspec colname="col3" colwidth="1*"/>
     <thead>
      <row>
       <entry>Function</entry>
       <entry>Description</entry>
       <entry>Support Number</entry>
      </row>
     </thead>
     <tbody>
      <row>
       <entry><function>compare</function></entry>
       <entry>
        compare two keys and return an integer less than zero, zero,
        or greater than zero, indicating whether the first key is less than,
        equal to, or greater than the second
       </entry>
       <entry>1</entry>
      </row>
      <row>
       <entry><function>extractValue</function></entry>
       <entry>extract keys from a value to be indexed</entry>
       <entry>2</entry>
      </row>
      <row>
       <entry><function>extractQuery</function></entry>
       <entry>extract keys from a query condition</entry>
       <entry>3</entry>
      </row>
      <row>
       <entry><function>consistent</function></entry>
       <entry>
        determine whether value matches query condition (Boolean variant)
        (optional if support function 6 is present)
       </entry>
       <entry>4</entry>
      </row>
      <row>
       <entry><function>comparePartial</function></entry>
       <entry>
        compare partial key from
        query and key from index, and return an integer less than zero, zero,
        or greater than zero, indicating whether GIN should ignore this index
        entry, treat the entry as a match, or stop the index scan (optional)
       </entry>
       <entry>5</entry>
      </row>
      <row>
       <entry><function>triConsistent</function></entry>
       <entry>
        determine whether value matches query condition (ternary variant)
        (optional if support function 4 is present)
       </entry>
       <entry>6</entry>
      </row>
      <row>
       <entry><function>options</function></entry>
       <entry>
        define options that are specific to this operator class
        (optional)
       </entry>
       <entry>7</entry>
      </row>
     </tbody>
    </tgroup>
   </table>

  <para>
   BRIN indexes have five basic support functions, one of which is optional,
   as shown in <xref linkend="xindex-brin-support-table"/>.  Some versions of
   the basic functions require additional support functions to be provided.
   (For more information see <xref linkend="brin-extensibility"/>.)
  </para>

   <table tocentry="1" id="xindex-brin-support-table">
    <title>BRIN Support Functions</title>
    <tgroup cols="3">
     <colspec colname="col1" colwidth="2*"/>
     <colspec colname="col2" colwidth="3*"/>
     <colspec colname="col3" colwidth="1*"/>
     <thead>
      <row>
       <entry>Function</entry>
       <entry>Description</entry>
       <entry>Support Number</entry>
      </row>
     </thead>
     <tbody>
      <row>
       <entry><function>opcInfo</function></entry>
       <entry>
        return internal information describing the indexed columns'
        summary data
       </entry>
       <entry>1</entry>
      </row>
      <row>
       <entry><function>add_value</function></entry>
       <entry>add a new value to an existing summary index tuple</entry>
       <entry>2</entry>
      </row>
      <row>
       <entry><function>consistent</function></entry>
       <entry>determine whether value matches query condition</entry>
       <entry>3</entry>
      </row>
      <row>
       <entry><function>union</function></entry>
       <entry>
        compute union of two summary tuples
       </entry>
       <entry>4</entry>
  

Title: GIN and BRIN Index Support Functions
Summary
This section details the support functions for GIN (Generalized Inverted Index) and BRIN (Block Range Index) in PostgreSQL. GIN indexes require seven support functions, three of which are mandatory (compare, extractValue, extractQuery) and four optional. These functions include operations like key comparison, value extraction, and query consistency checking. BRIN indexes, on the other hand, use five basic support functions, with one being optional. The mandatory BRIN functions include opcInfo, add_value, consistent, and union. Each function is assigned a specific support number and serves a unique purpose in the respective index's functionality. The text provides detailed tables for both index types, explaining the role of each function, whether it's mandatory or optional, and its corresponding support number. Additional information suggests that some versions of the basic BRIN functions may require extra support functions.