[postgis-users] GiST index on multiple columns?

Robin Chauhan robin.chauhan at gmail.com
Fri Jan 7 22:30:11 PST 2005


I am looking for advice on using a GiST index on multiple columns.

Would a 2 column GiST index be effective to index 2 'point' geometry
columns, for queries in which each point is constrained a distinct
box?  I am able to create a GiST index on 2 geometry columns, but I'm
not sure that it's effective.  I didnt see mention of multiple column
GiST indices in the manual.  The 2 points will represent start and end
points of a journey.

Also, I want to improve the performance of a query which involves
conditions on both 2 spatial columns (of type 'geometry') and 3
non-spatial columns (of type integer and float).    Now GiST indexes
appear to only allow geometric columns to be indexed.  So I am
considering storing/coercing numeric types into geometries, just to
allow them to be indexed along with the geometries, hopefully
improving performance.  The integer types have a relatively small
number of distinct values (like 20).

Could you comment on this scheme?  Could this really work?  If not, is
there another way I can index more columns when some are spatial (an
R-Tree index maybe? They also do not allow for simple non-spatial

Thanks in advance for your advice,

-Robin Chauhan

More information about the postgis-users mailing list