Efficient sorted bounding box query
问题 How would I create indexes in PostgresSQL 8.3 which would make a sorted bounding box query efficient? The table I'm querying has quite a few rows. That is I want the create indexes that makes the following query as efficient as possible: SELECT * FROM features WHERE lat BETWEEN ? AND ? AND lng BETWEEN ? AND ? ORDER BY score DESC The features table look like this: Column | Type | ------------+------------------------+ id | integer | name | character varying(255) | type | character varying(255)