66.2. Built-in Operator Classes

|66.2. Built-in Operator Classes|                 |                           |                  |                                  |
|:-----------------------------:|-----------------|---------------------------|------------------|----------------------------------|
|   [Prev](spgist-intro.html)   |[Up](spgist.html)|Chapter 66. SP-GiST Indexes|[Home](index.html)| [Next](spgist-extensibility.html)|

---

## 66.2. Built-in Operator Classes

 The core PostgreSQL distribution includes the SP-GiST operator classes shown in [Table 66.1](spgist-builtin-opclasses.html#SPGIST-BUILTIN-OPCLASSES-TABLE).

**Table 66.1. Built-in SP-GiST Operator Classes**

|           Name           |  Indexable Operators  | Ordering Operators  |
|--------------------------|-----------------------|---------------------|
|        `box_ops`         |    `<< (box,box)`     |  `<-> (box,point)`  |
|      `&< (box,box)`      |                       |                     |
|      `&> (box,box)`      |                       |                     |
|      `>> (box,box)`      |                       |                     |
|      `<@ (box,box)`      |                       |                     |
|      `@> (box,box)`      |                       |                     |
|      `~= (box,box)`      |                       |                     |
|      `&& (box,box)`      |                       |                     |
|     `<<| (box,box)`      |                       |                     |
|     `&<| (box,box)`      |                       |                     |
|     `|&> (box,box)`      |                       |                     |
|     `|>> (box,box)`      |                       |                     |
|      `kd_point_ops`      |  `|>> (point,point)`  | `<-> (point,point)` |
|    `<< (point,point)`    |                       |                     |
|    `>> (point,point)`    |                       |                     |
|   `<<| (point,point)`    |                       |                     |
|    `~= (point,point)`    |                       |                     |
|     `<@ (point,box)`     |                       |                     |
|      `network_ops`       |   `<< (inet,inet)`    |                     |
|    `<<= (inet,inet)`     |                       |                     |
|     `>> (inet,inet)`     |                       |                     |
|    `>>= (inet,inet)`     |                       |                     |
|     `= (inet,inet)`      |                       |                     |
|     `<> (inet,inet)`     |                       |                     |
|     `< (inet,inet)`      |                       |                     |
|     `<= (inet,inet)`     |                       |                     |
|     `> (inet,inet)`      |                       |                     |
|     `>= (inet,inet)`     |                       |                     |
|     `&& (inet,inet)`     |                       |                     |
|        `poly_ops`        |`<< (polygon,polygon)` |`<-> (polygon,point)`|
|  `&< (polygon,polygon)`  |                       |                     |
|  `&> (polygon,polygon)`  |                       |                     |
|  `>> (polygon,polygon)`  |                       |                     |
|  `<@ (polygon,polygon)`  |                       |                     |
|  `@> (polygon,polygon)`  |                       |                     |
|  `~= (polygon,polygon)`  |                       |                     |
|  `&& (polygon,polygon)`  |                       |                     |
| `<<| (polygon,polygon)`  |                       |                     |
| `&<| (polygon,polygon)`  |                       |                     |
| `|>> (polygon,polygon)`  |                       |                     |
| `|&> (polygon,polygon)`  |                       |                     |
|     `quad_point_ops`     |  `|>> (point,point)`  | `<-> (point,point)` |
|    `<< (point,point)`    |                       |                     |
|    `>> (point,point)`    |                       |                     |
|   `<<| (point,point)`    |                       |                     |
|    `~= (point,point)`    |                       |                     |
|     `<@ (point,box)`     |                       |                     |
|       `range_ops`        |`= (anyrange,anyrange)`|                     |
| `&& (anyrange,anyrange)` |                       |                     |
|`@> (anyrange,anyelement)`|                       |                     |
| `@> (anyrange,anyrange)` |                       |                     |
| `<@ (anyrange,anyrange)` |                       |                     |
| `<< (anyrange,anyrange)` |                       |                     |
| `>> (anyrange,anyrange)` |                       |                     |
| `&< (anyrange,anyrange)` |                       |                     |
| `&> (anyrange,anyrange)` |                       |                     |
|`-|- (anyrange,anyrange)` |                       |                     |
|        `text_ops`        |    `= (text,text)`    |                     |
|     `< (text,text)`      |                       |                     |
|     `<= (text,text)`     |                       |                     |
|     `> (text,text)`      |                       |                     |
|     `>= (text,text)`     |                       |                     |
|    `~<~ (text,text)`     |                       |                     |
|    `~<=~ (text,text)`    |                       |                     |
|    `~>=~ (text,text)`    |                       |                     |
|    `~>~ (text,text)`     |                       |                     |
|     `^@ (text,text)`     |                       |                     |

 Of the two operator classes for type `point`, `quad_point_ops` is the default. `kd_point_ops` supports the same operators but uses a different index data structure that may offer better performance in some applications.

 The `quad_point_ops`, `kd_point_ops` and `poly_ops` operator classes support the `<->` ordering operator, which enables the k-nearest neighbor (`k-NN`) search over indexed point or polygon data sets.

---

|[Prev](spgist-intro.html)|[Up](spgist.html) | [Next](spgist-extensibility.html)|
|:------------------------|:----------------:|---------------------------------:|
|   66.1. Introduction    |[Home](index.html)|        66.3. Extensibility       |

 // \<![CDATA[ \<-- For SVG support if ('WebSocket' in window) { (function() { function refreshCSS() { var sheets = [].slice.call(document.getElementsByTagName("link")); var head = document.getElementsByTagName("head")[0]; for (var i = 0; i \< sheets.length; ++i) { var elem = sheets[i]; head.removeChild(elem); var rel = elem.rel; if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { var url = elem.href.replace(/(&|\\?)\_cacheOverride=\\d+/, ''); elem.href = url + (url.indexOf('?') \>= 0 ? '&' : '?') + '\_cacheOverride=' + (new Date().valueOf()); } head.appendChild(elem); } } var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var address = protocol + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(address); socket.onmessage = function(msg) { if (msg.data == 'reload') window.location.reload(); else if (msg.data == 'refreshcss') refreshCSS(); }; console.log('Live reload enabled.'); })(); } // ]]\>