Skip to content

68.2. 内置运算符类#

核心PostgreSQL发行版包含表 68.1中所示的GiST运算符类。(附录 F中描述的一些可选模块提供了其他GiST运算符类。)

表 68.1. 内置GiST运算符类

名称可索引运算符排序运算符
box_ops<< (box, box)<-> (box, point)
&<(盒子,盒子)
&&(盒子,盒子)
&>(盒子,盒子)
>>(盒子,盒子)
~=(盒子,盒子)
@>(盒子,盒子)
<@(盒子,盒子)
&<|(盒子,盒子)
<<|(盒子,盒子)
|>>(盒子,盒子)
|&>(盒子,盒子)
~(盒子,盒子)
@(盒子,盒子)
circle_ops<<(圆,圆)<->(圆,点)
&<(圆,圆)
&>(圆,圆)
>>(圆,圆)
<@(圆,圆)
@>(圆,圆)
~=(圆,圆)
&&(圆,圆)
|>>(圆,圆)
<<|(圆,圆)
&<|(圆,圆)
|&>(圆,圆)
@(圆,圆)
~(圆,圆)
inet_ops<<(inet,inet)
<<=(inet,inet)
>>(inet,inet)
>>=(inet,inet)
=(inet,inet)
<>(inet,inet)
<(inet,inet)
<=(inet,inet)
>(inet,inet)
>=(inet,inet)
&&(inet,inet)
multirange_ops=(anymultirange,anymultirange)
&&(anymultirange,anymultirange)
&&(anymultirange,anyrange)
@>(anymultirange,anyelement)
@>(anymultirange,anymultirange)
@>(anymultirange,anyrange)
<@(anymultirange,anymultirange)
<@(anymultirange,anyrange)
<<(anymultirange,anymultirange)
<<(anymultirange,anyrange)
>>(anymultirange,anymultirange)
>>(anymultirange,anyrange)
&<(anymultirange,anymultirange)
&<(anymultirange,anyrange)
&>(anymultirange,anymultirange)
&>(anymultirange,anyrange)
-|-(anymultirange,anymultirange)
-|-(anymultirange,anyrange)
point_ops|>>(点,点)<->(点,点)
<<(点,点)
>>(点,点)
<<|(点,点)
~=(点,点)
<@(点,盒子)
<@(点,多边形)
<@(点,圆)
poly_ops<<(多边形,多边形)<->(多边形,点)
&<(多边形,多边形)
&>(多边形,多边形)
>>(多边形,多边形)
<@(多边形,多边形)
@>(多边形,多边形)
~=(多边形,多边形)
&&(多边形,多边形)
<<|(多边形,多边形)
&<|(多边形,多边形)
|&>(多边形,多边形)
|>>(多边形,多边形)
@(多边形,多边形)
~(多边形,多边形)
range_ops=(任意范围,任意范围)
&&(任意范围,任意范围)
&&(任意范围,任意多范围)
@>(任意范围,任意元素)
@>(任意范围,任意范围)
@>(任意范围,任意多范围)
<@(任意范围,任意范围)
<@(任意范围,任意多范围)
<<(任意范围,任意范围)
<<(任意范围,任意多范围)
>>(任意范围,任意范围)
>>(任意范围,任意多范围)
&<(任意范围,任意范围)
&<(任意范围,任意多范围)
&>(任意范围,任意范围)
&>(任意范围,任意多范围)
-|-(任意范围,任意范围)
-|-(任意范围,任意多范围)
tsquery_ops<@(tsquery,tsquery)
@>(tsquery,tsquery)
tsvector_ops@@(tsvector,tsquery)

由于历史原因,inet_ops运算符类不是inetcidr类型的默认类。要使用它,请在CREATE INDEX中提及类名,例如

CREATE INDEX ON my_table USING GIST (my_inet_column inet_ops);