<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">I'm running PostGIS from Subversion
      trunk.<br>
      <br>
      This is my first time looking at this code, so maybe I'm missing
      something, but from what I've seen I see this:<br>
      <br>
      The new code needs to build some circular-area-tree structures. It
      tries to cache them. That cache is stored in the "generic cache"
      list which is in turn stored in fcinfo->flinfo->fn_extra.
      This seems to be cleared every time, so there's never a cache. And
      then the code in geography_measurement.c always falls back to a
      much slower code, here:<br>
      <br>
      <blockquote>        /* Do the brute force calculation if the
        cached calculation doesn't tick over */<br>
                if ( LW_FAILURE == geography_distance_cache(fcinfo, g1,
        g2, &s, &distance) )<br>
                {<br>
      </blockquote>
      <br>
      In any case... why not falling back to create the structures.. as
      geography_distance_tree does?<br>
      <br>
      Thanks!<br>
      <br>
      El 06/01/14 18:06, Paul Ramsey escribió:<br>
    </div>
    <blockquote
cite="mid:CACowWR0iEdEzJo8yTB_PYdKNPRBNOzareOVfvRh6P+NsNgb8VA@mail.gmail.com"
      type="cite">
      <pre wrap="">Let's talk on -devel.

Could you point out which version you're looking at, first of all, in
case there's differences between versions?

Thanks,

P.

On Mon, Jan 6, 2014 at 7:35 AM, Nicolás Lichtmaier <a class="moz-txt-link-rfc2396E" href="mailto:nicolasl@wolfram.com"><nicolasl@wolfram.com></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">I'm trying to solve a mistery (and I didn't know is I should post here or to
the the devel list)

ST_Distance between complex polygons is very slow here, despite the work
done in <a class="moz-txt-link-freetext" href="http://boundlessgeo.com/2012/07/making-geography-faster/">http://boundlessgeo.com/2012/07/making-geography-faster/</a> .. It's
taking like 4 seconds.

Looking harder into this I see there's a _st_distancetree(geo1, geo2) that
completes the task in 171 ms....

It seems to me that the standard ST_Distance is not using the new "circular
bounding boxes" code...

So I downloaded the source code and I saw that geography_distance_cache
always fails because GetCircTreeGeomCache always returns null. I see that a
cache is initialized and put into a "generic cache" array, but then is reset
to null in GetGenericCacheCollection when called from GetPROJ4SRSCache
beacuse "fcinfo->flinfo->fn_extra" is again null... (set in
MemoryContextAllocZero)

Does this what I am saying make sense? =)

How is this cache supposed to work?

Thanks for any help!

--
Nicolás.-


_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a>
</pre>
      </blockquote>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Nicolás.-</pre>
  </body>
</html>