RE: st_within too slow? -- room for development improvement?
Pedro Doria Meunier <pdoria <at> netmadeira.com>
2008-09-02 12:29:21 GMT
Thanks for your suggestion :)
The thing is that using st_intersects doesn't help.
The performance is exactly the same which actually puzzles me for
functions (namely ST_Within) that should return almost instantly ...
Problem being that as far as I can see there's no other function that
replaces these for the same effect...
(Call to developers)
This leads me to asking: isn't there room for improvement in these
The above functions are suitable for very small scale implementations
(like for fleets < 50 vehicles) but when it comes to real-world
implementations with fleets >200 vehicles using these functions almost
grinds the location implementation to a screeching halt...
All the best,
On Sat, 2008-08-30 at 08:59 -0400, Obe, Regina wrote:
> Try using st_intersects instead of ST_within. In general I think it
> performs better than within and for point in poly will be just as
> Yah Guido's suggestion would be at best give same timing since
> ST_Within, ST_Intersects have an implicit && call in them so they can
> limit the number of more painful _ST_Within, _ST_Intersects checks
> they actually need to do.
> Hope that helps,
> -----Original Message-----
> From: postgis-users-bounces <at> postgis.refractions.net on behalf of Pedro
> Doria Meunier
> Sent: Sat 8/30/2008 8:16 AM
> To: PostGIS Users Discussion
> Subject: RE: [postgis-users] st_within too slow?
> Dear Guido,
> Thanks for replying.
> Your suggested mod actually worsens the performance by another
> 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
> The substance of this message, including any attachments, may be
> confidential, legally privileged and/or exempt from disclosure
> pursuant to Massachusetts law. It is intended solely for the
> addressee. If you received this in error, please contact the sender
> and delete the material from any computer.
> Help make the earth a greener place. If at all possible resist
> printing this email and join us in saving paper.
> postgis-users mailing list
> postgis-users <at> postgis.refractions.net
postgis-users mailing list
postgis-users <at> postgis.refractions.net