[postgis-users] st_within too slow?
Pedro Doria Meunier
pdoria at netmadeira.com
Sat Aug 30 05:16:38 PDT 2008
Dear Guido,
Thanks for replying.
Your suggested mod actually worsens the performance by another ~15-20ms
Best regards,
--
Pedro Doria Meunier <pdoria at netmadeira.com>
> Pedro,
>
> Try this instead:
>
> SELECT road_network, toponymy FROM maps AS m WHERE m.b_box &&
> geomfromtext('POINT($lon $lat)',4326) and
> st_within(geomfromtext('POINT($lon $lat)',4326), m.b_box)
>
> of course, if you already know that the point is in Portugal,
> you could do:
>
> SELECT road_network, toponymy FROM maps AS m WHERE
> m.country = 'PT' and
> m.b_box && geomfromtext('POINT($lon $lat)',4326)
>
> (assuming that the maps table has the 'country' column with
> country names).
>
> GL
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080830/2121e740/attachment.pgp>
More information about the postgis-users
mailing list