[postgis-users] Question on performance probably related to detoast and/or bboxes

Ben Madin ben at ausvet.com.au
Sun Nov 20 15:50:39 PST 2016


Thanks Regina,

even if it doesn't help Stephen all that much, it is helpful to me !

cheers

Ben



On 19 November 2016 at 19:44, Regina Obe <lr at pcorp.us> wrote:

>
> ----
>
> Hi Regina,
>
> On 11/18/2016 3:28 AM, Regina Obe wrote:
>
> Since you are doing 0.0, you might be better off using ST_Intersects
>
> So
>
> st_dwithin(pnt, a.geom, 0.0)
>
> change to:
>
> ST_Intersects(pnt,a.geom)
>
>
> Did this change recently? I was under the impression that st_dwithin was
> faster than st_intersects? Anyway, this is good to know, Thanks!
>
>
>
>                                                 No it didn't,
> ST_Intersects has generally always been faster.  In most cases
> ST_Intersects is faster than ST_DWithin since it can take advantage of
> certain topological features of a geometry, so it not quite as sensitive to
> the number of points as ST_DWithin is.  It also supports prepared
> geometry.  Paul can correct me, but I don't think we've added prepared
> geometry support for ST_DWithin. That means it should perform much better
> when comparing a biggo single geometry against a lot of different
> geometries.
>
>
>
> ST_DWithin was much slower until Nicklas made some major improvements a
> while back which increased the speed I think 10 fold, making it in many
> cases almost as fast and sometimes faster than ST_Intersects.
>
>
>
> That said the main benefit of ST_Dwithin is
>
>
>
> 1)      You can provide a tolerance which you can't with ST_Intersects,
> and it will short-circuit if it hits that tolerance (doesn't need to
> compute full distance)
>
> 2)      It doesn't care if your geometry is invalid, where as
> ST_Intersects will often throw up its hands and throw false in your face
> regardless how close the geometries are because the DEIM it relies on needs
> the geometries to be valid.
>
>
>
> Hope that helps,
>
> Regina
>
> http://www.postgis.us
>
> http://postgis.net
>
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/postgis-users
>



-- 

Ben Madin



m : +61 448 887 220 t : +61 8 9336 5022

e : ben at ausvet.com.au

10 High Street, Fremantle
Western Australia

find us: http://w3w.co/duke.basket.decks

on the web: www.ausvet.com.au


This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please delete
it and notify the sender. The contents of this email are the opinion of the
writer only and are not endorsed by Ausvet unless expressly stated
otherwise. Although Ausvet uses virus scanning software we do not accept
liability for viruses or similar in any attachments. Thanks for reading.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20161121/2fee00ac/attachment.html>


More information about the postgis-users mailing list