<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: [postgis-devel] What's the point of this exercise in intersects?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>>> It gets better, since the bbox check often recurs in the GEOS code<BR>
>> base too. However, it's not exactly a high cost check, and there are<BR>
>> cases where there functions will be called sans indexes. Doing the<BR>
>> check in postgis potentially saves a trip to GEOS. The GEOS checks<BR>
>> have to be there to support pure-GEOS apps.<BR>
<BR>
>> C'est la vie.<BR>
<BR>
>> P.<BR>
<BR>
Paul,<BR>
<BR>
I wish I could be so accepting of lifeas you. Perhaps life would be much easier for me to bear.<BR>
<BR>
The GEOS bbox extra check I whole-heartedly accept as the price of sharing code.  The<BR>
PostGIS one though - it seems even if other projects were sharing PostGIS code, these functions<BR>
are so tied to PostgreSQL  that they would be taking advantage of the same treats we are and cursory inspecting the code base<BR>
couldn't find a situation where this would be called sans indexes except by newbies (maybe I didn't inspect enough). <BR>
<BR>
So which places do you see where you would ever call this function and not have already done a bounding box check already?<BR>
<BR>
I know for normal loads this is a not a high cost check, but it seems when you get into the millions this<BR>
could become costly.  Take for example Pedro's question<BR>
<BR>
<A HREF="http://postgis.refractions.net/pipermail/postgis-users/2008-September/021061.html">http://postgis.refractions.net/pipermail/postgis-users/2008-September/021061.html</A><BR>
<BR>
I had dismissed this difference in speed between ST_Dwithin and ST_Intersects, ST_Within , as the cost of<BR>
crossing the GEOS barrier.  On further inspection - I see there is a short-circuit for dealing with Point in Polys and he had a point in poly case<BR>
so it should never have crossed the geos barrier anyway (unless this short-circuit isn't in the release version hmm have to check that).  So what is the reason for this discrepancy in timing.  I can't imagine a distance check would be anymore efficient.<BR>
<BR>
Perhaps I'm just making a mountain out of a mole hill though.<BR>
<BR>
Thanks,<BR>
Regina<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>
<HTML><BODY><P><hr size=1></P>
<P><STRONG>
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.
</STRONG></P></BODY></HTML>

<P><hr size=1></P>
<P><STRONG><font size="2" color="339900"> Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper. </p> <p> </font></STRONG></P>