9.0 release notes对于 PostgreSQL 声明以下更改:
Add point_ops operator class for GiST (Teodor Sigaev)
This feature permits GiST indexing of point columns. The index can be used for several types of queries such as
point <@ polygon
(point is in polygon). This should make many PostGIS queries faster.
我有一个非常大的表(数百万行),其中包含 GEOMETRY(POINT,[SRID])
我有时将其与多边形进行比较的列。创建索引时我需要做些什么来启用它吗?我是否必须使用他们指示的运算符,或者这是否适用于 ST_Contains
?
(我确定答案在某处的文档中,但我找不到。)
最佳答案
它是一个 opclass,因此您可以在 CREATE INDEX
命令中指定它:
CREATE INDEX idx_name ON tablename USING GiST (col_name point_ops);
关于performance - 带有 GiST PostGIS 空间索引的 PostgreSQL point_ops,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16927331/