[postgis-users] Looking for more performance on select

Webb Sprague webb.sprague at gmail.com
Fri Dec 29 08:41:23 PST 2006


> >
> > The query with a join between the 2 table runs in near 60s:
> > SELECT gid as id, source::integer, target::integer, cost::double precision
> > as cost,reverse_cost::double precision as reverse_cost FROM streets_db_edges
> > as s,streets_db_big as m
> > where m.edge_id=s.id and setsrid('BOX3D(1.65924 43.38176,3.16274
> > 50.73713)'::BOX3D,4326) && m.the_geom

FWIW:  Have you tried experimenting on the order of your WHERE
conditions?  I wonder if doing the bounding box join first would give
you better results, because it might narrow the field quicker.  No
promises, but it is an easy experiment.