阅读(1772) (0)

PostgreSQL 内建操作符类

2021-08-24 10:47:28 更新

表 65.1中展示了PostgreSQL 核心发布所包括的SP-GiST操作符类。

表 65.1. 内建 SP-GiST 操作符类

名称 索引数据类型 可索引操作符 排序运算符
kd_point_ops point << <@ <^ >> >^ ~= <->
quad_point_ops point << <@ <^ >> >^ ~= <->
range_ops 任何范围类型 && &< &> -|- << <@ = >> @>
box_ops box << &< && &> >> ~= @> <@ &<| <<| |>> |&> <->
poly_ops polygon << &< && &> >> ~= @> <@ &<| <<| |>> |&> <->
text_ops text < <= = > >= ~<=~ ~<~ ~>=~ ~>~ ^@
inet_ops inet, cidr && >> >>= > >= <> << <<= < <= =

在用于类型point的两种操作符类中,quad_point_ops是默认值。kd_point_ops支持相同的操作符,但是使用一种不同的索引数据结构,在某些应用中它可以提供更好的性能。

quad_point_opskd_point_opspoly_ops 运算符类别支持<->排序运算符, 支持在索引点或多边形数据集上进行k-最近邻(k-NN)搜索。