Home Explore Blog CI



postgresql

17th chunk of `doc/src/sgml/brin.sgml`
59becd871ecfe577b92a016c92f6d1d60d6ca8e648eb02b10000000100000c2d
 type as the operator class,
    and return the union of them.  The inclusion operator class can store union
    values with different data types if it is defined with the
    <literal>STORAGE</literal> parameter.  The return value of the union
    function should match the <literal>STORAGE</literal> data type.
 </para>

 <para>
    Support function numbers 12 and 14 are provided to support
    irregularities of built-in data types.  Function number 12
    is used to support network addresses from different families which
    are not mergeable.  Function number 14 is used to support
    empty ranges.  Function number 13 is an optional but
    recommended one, which allows the new value to be checked before
    it is passed to the union function.  As the BRIN framework can shortcut
    some operations when the union is not changed, using this
    function can improve index performance.
 </para>

 <para>
  To write an operator class for a data type that implements only an equality
  operator and supports hashing, it is possible to use the bloom support procedures
  alongside the corresponding operators, as shown in
  <xref linkend="brin-extensibility-bloom-table"/>.
  All operator class members (procedures and operators) are mandatory.
 </para>

 <table id="brin-extensibility-bloom-table">
  <title>Procedure and Support Numbers for Bloom Operator Classes</title>
  <tgroup cols="2">
   <thead>
    <row>
     <entry>Operator class member</entry>
     <entry>Object</entry>
    </row>
   </thead>
   <tbody>
    <row>
     <entry>Support Procedure 1</entry>
     <entry>internal function <function>brin_bloom_opcinfo()</function></entry>
    </row>
    <row>
     <entry>Support Procedure 2</entry>
     <entry>internal function <function>brin_bloom_add_value()</function></entry>
    </row>
    <row>
     <entry>Support Procedure 3</entry>
     <entry>internal function <function>brin_bloom_consistent()</function></entry>
    </row>
    <row>
     <entry>Support Procedure 4</entry>
     <entry>internal function <function>brin_bloom_union()</function></entry>
    </row>
    <row>
     <entry>Support Procedure 5</entry>
     <entry>internal function <function>brin_bloom_options()</function></entry>
    </row>
    <row>
     <entry>Support Procedure 11</entry>
     <entry>function to compute hash of an element</entry>
    </row>
    <row>
     <entry>Operator Strategy 1</entry>
     <entry>operator equal-to</entry>
    </row>
   </tbody>
  </tgroup>
 </table>

 <para>
    Support procedure numbers 1-10 are reserved for the BRIN internal
    functions, so the SQL level functions start with number 11.  Support
    function number 11 is the main function required to build the index.
    It should accept one argument with the same data type as the operator class,
    and return a hash of the value.
 </para>

 <para>
  The minmax-multi operator class is also intended for data types implementing
  a totally ordered set, and may be seen as a simple extension of the minmax
  operator class. While minmax operator class summarizes values from each block
  range into a single contiguous

Title: BRIN Operator Class Support Functions and Bloom Procedures
Summary
The BRIN framework provides support functions and procedures for creating operator classes, including those for inclusion and equality operators. Support functions 11-14 are used for tasks such as calculating unions, checking mergeability, and handling empty ranges. Bloom support procedures, including brin_bloom_opcinfo and brin_bloom_add_value, are used for operator classes that implement hashing and equality operators. These procedures and support functions enable efficient indexing and querying of complex data types, including those with totally ordered sets.