Per-Olof-

  you have gone to the solution faster than I
I came home after taking a break, and wrote simply

SELECT count(*) FROM a b
WHERE
  a.city = 'San Francisco'
AND a.geom_pts &&
  SetSRID( 'BOX(x1 y1,x2 y2)'::box2d, 4326)
AND
  st_within( a.geom_pts, SetSRID( b.the_geom, 4326))

The results are 8x faster, even with a big sloppy box

 Somehow I thought PostGIS would do a simple box before the complex math
Obviously this is not true. I am surprised, but finally am getting somewhere

I thank you kindly for you thorough response
I felt as if I was having only bad results
I will take this further now that I have something that is working
best regards from berkeley, CA
  -Brian

_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to