PostgreSQL支持表达式的索引以及部分索引,您可以将它们混合使用。
这只是一个随机的猜测,我不知道它是否有效,但请尝试一下:
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



