diff --git a/doc/src/sgml/ref/create_opclass.sgml b/doc/src/sgml/ref/create_opclass.sgml index 527f33c7a8..7b9d55d38d 100644 --- a/doc/src/sgml/ref/create_opclass.sgml +++ b/doc/src/sgml/ref/create_opclass.sgml @@ -172,7 +172,7 @@ CREATE OPERATOR CLASS name [ DEFAUL the input data type(s) of the function (for B-tree comparison functions and hash functions) or the class's data type (for B-tree sort support functions and all - functions in GiST, SP-GiST and GIN operator classes). These defaults + functions in GiST, SP-GiST, GIN and BRIN operator classes). These defaults are correct, and so op_type need not be specified in FUNCTION clauses, except for the case of a B-tree sort @@ -232,7 +232,7 @@ CREATE OPERATOR CLASS name [ DEFAUL The data type actually stored in the index. Normally this is the same as the column data type, but some index methods - (currently GiST and GIN) allow it to be different. The + (currently GiST, GIN and BRIN) allow it to be different. The STORAGE clause must be omitted unless the index method allows a different type to be used. diff --git a/doc/src/sgml/xindex.sgml b/doc/src/sgml/xindex.sgml index aaf9d8cd1f..0535dda492 100644 --- a/doc/src/sgml/xindex.sgml +++ b/doc/src/sgml/xindex.sgml @@ -322,6 +322,49 @@ + + BRIN indexes are similar to GiST, SP-GiST and GIN indexes in that they + don't have a fixed set of strategies either. Instead the support routines + of each operator class interpret the strategy numbers according to the + operator class's definition. As an example, the strategy numbers used by + the built-in Minmax operator classes are shown in + . + + + + BRIN Minmax Strategies + + + + Operation + Strategy Number + + + + + less than + 1 + + + less than or equal + 2 + + + equal + 3 + + + greater than or equal + 4 + + + greater than + 5 + + + +
+ Notice that all the operators listed above return Boolean values. In practice, all operators defined as index method search operators must @@ -601,6 +644,53 @@ + + BRIN indexes have four basic support functions, as shown in + ; those basic functions + may require additional support functions to be provided. + (For more information see .) + + + + GIN Support Functions + + + + Function + Description + Support Number + + + + + opcInfo + + return internal information describing the indexed columns' + summary data + + 1 + + + add_value + add a new value to an existing summary index tuple + 2 + + + consistent + determine whether value matches query condition + 3 + + + union + + compute union of two summary tuples + + 4 + + + +
+ Unlike search operators, support functions return whichever data type the particular index method expects; for example in the case @@ -609,7 +699,7 @@ dependent on the index method. For B-tree and hash the comparison and hashing support functions take the same input data types as do the operators included in the operator class, but this is not the case for - most GiST, SP-GiST, and GIN support functions. + most GiST, SP-GiST, GIN, and BRIN support functions. @@ -994,6 +1084,14 @@ ALTER OPERATOR FAMILY integer_ops USING btree ADD handle.
+ + In BRIN, the requirements depends on the framework that provides the + operator classes. For operator classes based on minmax, + the behavior required is the same as for B-tree operator families: + all the operators in the family must sort compatibly, and casts must + not change the associated sort ordering. + + Prior to PostgreSQL 8.3, there was no concept @@ -1178,7 +1276,7 @@ CREATE OPERATOR CLASS polygon_ops STORAGE box; - At present, only the GiST and GIN index methods support a + At present, only the GiST, GIN and BRIN index methods support a STORAGE type that's different from the column data type. The GiST compress and decompress support routines must deal with data-type conversion when STORAGE @@ -1188,6 +1286,10 @@ CREATE OPERATOR CLASS polygon_ops integer-array columns might have keys that are just integers. The GIN extractValue and extractQuery support routines are responsible for extracting keys from indexed values. + BRIN is similar to GIN: the STORAGE type identifies the + type of the stored summary values, and operator classes' support + procedures are responsible for interpreting the summary values + correctly.