Functional R-tree indexes
Under certain conditions, you can create a functional R-tree index, using one of the several spatial data type functions. A functional index is built using the value returned by a function rather than the value of a column in a table.
For example, you can create an R-tree index on the centroids
of the objects in a table, rather than on the objects themselves:
CREATE TABLE poly_tab (poly_col ST_Geometry);
CREATE INDEX centroid_idx ON poly_tab
(ST_Centroid(poly_col) ST_Geometry_ops) USING RTREE;
You
can use the following spatial data type functions in a functional
index:
- ST_Centroid()
- ST_EndPoint()
- ST_Envelope()
- SE_Midpoint()
- ST_Point()
- ST_PointN()
- ST_PointOnSurface()
- ST_StartPoint()