Wiki / Operator Families / GiST classes
gist/box_ops (class)
GiST operator class for box; member of box_ops.
Reading PostgreSQL 18.6.
Description
GiST operator class for box; member of box_ops.
- Object kind
- Operator class
- Index AM
- GiST
- Input type
- box
- Stored key type
- Same as input type (catalog zero)
- Default class
- yes
Usage
gist/box_opsOperator classes and families
An index definition can specify an operator class for each column of an index.
The operator class identifies the operators to be used by the index for that column. For example, a B-tree index on the type int4 would use the int4_ops class; this operator class includes comparison functions for values of type int4 . In practice the default operator class for the column's data type is usually sufficient. The main reason for having operator classes is that for some data types, there could be more than one meaningful index behavior. For example, we might want to sort a complex-number data type either by absolute value or by real part. We could do this by defining two operator classes for the data type and then selecting the proper class when making an index. The operator class determines the basic sort ordering (which can then be modified by adding sort options COLLATE , ASC / DESC and/or NULLS FIRST / NULLS LAST ).
There are also some built-in operator classes besides the default ones:
Family operator strategies
| Operator overload | Strategy | Purpose | Ordering family | Membership scope | Source description |
|---|---|---|---|---|---|
| <<(box,box) | 1 | search | Class input pair | is left of | |
| &<(box,box) | 2 | search | Class input pair | overlaps or is left of | |
| &&(box,box) | 3 | search | Class input pair | overlaps | |
| &>(box,box) | 4 | search | Class input pair | overlaps or is right of | |
| >>(box,box) | 5 | search | Class input pair | is right of | |
| ~=(box,box) | 6 | search | Class input pair | same as | |
| @>(box,box) | 7 | search | Class input pair | contains | |
| <@(box,box) | 8 | search | Class input pair | is contained by | |
| &<|(box,box) | 9 | search | Class input pair | overlaps or is below | |
| <<|(box,box) | 10 | search | Class input pair | is below | |
| |>>(box,box) | 11 | search | Class input pair | is above | |
| |&>(box,box) | 12 | search | Class input pair | overlaps or is above | |
| <->(box,point) | 15 | ordering | float_ops | Family member | distance between |
Family support functions
| Support number | Left type | Right type | Function signature | Result type |
|---|---|---|---|---|
| 1 | box | box | gist_box_consistent(internal,box,int2,oid,internal) | bool |
| 2 | box | box | gist_box_union(internal,internal) | box |
| 5 | box | box | gist_box_penalty(internal,internal,internal) | internal |
| 6 | box | box | gist_box_picksplit(internal,internal) | internal |
| 7 | box | box | gist_box_same(box,box,internal) | internal |
| 8 | box | box | gist_box_distance(internal,box,int2,oid,internal) | float8 |
| 12 | any | any | gist_translate_cmptype_common(int4) | int2 |
Classes in this family
Related entries
Documentation and source
- Matching PostgreSQL source archive
- PostgreSQL 18 English manual: indexes-opclass.html
- PostgreSQL 18 English manual: catalog-pg-opclass.html
- PostgreSQL 18 English manual: catalog-pg-amop.html
- PostgreSQL 18 English manual: catalog-pg-amproc.html
Source build
- Version
- 18.6
- Build
- https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2
- Source fingerprint
555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f
Compare versions
PostgreSQL 13 → 14: changed.
--- PostgreSQL 13
+++ PostgreSQL 14
@@ -63,26 +63,6 @@
"family": "box_ops",
"left_type": "box",
"method": "gist",
- "operator": "~(box,box)",
- "purpose": "search",
- "right_type": "box",
- "sort_family": "",
- "strategy": "13"
- },
- {
- "family": "box_ops",
- "left_type": "box",
- "method": "gist",
- "operator": "@(box,box)",
- "purpose": "search",
- "right_type": "box",
- "sort_family": "",
- "strategy": "14"
- },
- {
- "family": "box_ops",
- "left_type": "box",
- "method": "gist",
"operator": "&<(box,box)",
"purpose": "search",
"right_type": "box",
Compares recorded interfaces and attributes. Source fingerprints and build metadata are excluded; an absent sample is not proof of the introduction or removal release.
Related entries
Export JSON · Back to Operator Families · Recorded in PostgreSQL 10 through 20; the first sample is not necessarily its introduction.