[postgis-users] use index for "order by xmin(geom)"

Mike Toews mwtoews at gmail.com
Wed May 16 12:23:11 PDT 2012


Hi Melchior,

"xmin" is actually a PostgreSQL system column used for transactions,
not a PostGIS function.

http://www.postgresql.org/docs/current/static/ddl-system-columns.html

The KNN nearest neighbour feature that I think you are describing is
the <-> and <#> operators. Check out the documentation for more:

http://postgis.refractions.net/docs/geometry_distance_centroid.html
http://postgis.refractions.net/docs/geometry_distance_box.html

-Mike

On 17 May 2012 03:05, Melchior Moos <melchior.moos at gmail.com> wrote:
> I recently read that postgis 2.0 can use the index in order by clauses
> to find nearest neighbours of geometries. Is there also a way to use
> the index for queries like
> SELECT * FROM xy ORDER BY xmin(geom); ?
> Best regards,
> Melchior Moos



More information about the postgis-users mailing list