Postgresql 中文操作指南

69.2. Built-in Operator Classes #

PostgresSQL 核心发行版中的 SP-GiST 运算符类显示在 Table 69.1 中。

Table 69.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)_

inet_ops

<< (inet,inet)

<⇐ (inet,inet)

>> (inet,inet)

>>= (inet,inet)

= (inet,inet)

<> (inet,inet)

< (inet,inet)

⇐ (inet,inet)

> (inet,inet)

>= (inet,inet)

&& (inet,inet)

kd_point_ops

_

>> (point,point)_

<→ (point,point)

<< (point,point)

>> (point,point)

_<<

(point,point)_

~= (point,point)

<@ (point,box)

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)

对于类型 point 的两个算子类,quad_point_ops 是默认值。kd_point_ops 支持相同的算子,但使用不同的索引数据结构,这在某些应用程序中可能会提供更好的性能。

quad_point_opskd_point_opspoly_ops 算子类支持 <→ 排序算子,该算子支持索引点或多边形数据集中 k 近邻 (k-NN) 搜索。