On 6 September 2013 16:38, Pepijn Van Eeckhoudt <pep...@vaneeckhoudt.net> wrote: > Hi, > > In the extension I'm developing (https://bitbucket.org/luciad/libgpkg) > I'm currently adding support for queries like: > select Distance( > GeomFromText('Point(13.457 3)'), > geometry > ) from table; > > GeomFromText takes a string and outputs a geometry blob > Distance takes two geometry blobs and returns a double > > In order to speed up the distance function I was wondering if I could > use aux_data to cache the parsed version of the first parameter since > this remains the same for every call. So far I haven't been able to get > this to work though, aux_data is always NULL, no matter what I try. > > My hunch is that this is because the first parameter is the result of a > function call which could in theory return different values for each row > even if the input parameters are constant. Is that correct? > > Are there any other ways to kind of memoize the GeomFromText function > (or the parameters to distance) besides aux_data?
select Distance( constGeom, geometry ) from table, (select GeomFromText('Point(13.457 3)') as constGeom ); > > Thanks, > > Pepijn > Regards, Simon _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users