postgres spatial indexing

有些话、适合烂在心里 提交于 2019-11-30 23:58:31

PostgreSQL support indexes on expressions and also partial indexes, you can probably mix them.

This is just a random guess, I don't know if it works, but give it a try:

CREATE INDEX foobar ON table (distance(POINT(0,0), location))
 WHERE distance(POINT(0,0), location) <= 1000;

http://www.postgresql.org/docs/9.0/interactive/indexes-expressional.html

http://www.postgresql.org/docs/9.0/interactive/indexes-partial.html

Have you looked into Postgis and contrib/earthdistance?

http://www.postgis.org/

http://www.postgresql.org/docs/9.0/interactive/earthdistance.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!