I don't know about combining indexes but you want to include a spatial operator such as && in addition to Distance so that you can take advantage of an index on "the_geom".
> -----Original Message----- > From: [email protected] > [mailto:[email protected]] On > Behalf Of M.A. (Thijs) van den Berg > Sent: 18 March 2009 11:57 > To: [email protected] > Subject: [postgis-users] Can I build an index on combined > non-spatial &spatial columns? > > Suppose I want to speedup the following type of queries with > an index: > > SELECT the_geom, building_name > FROM buildings > WHERE Distance(the_geom, 'POINT(100312 102312)') < 5000 > AND building_type = 'School' > > Is that possible, and if not, why not? My current option is > to write my own index storage in C++, using a hashmap to > filter building_type, and build separate spatial indices for > each building type. Can I do something similar in postgresql? > Would my only option be to split the building_types into > separate tables? > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
