[postgis-users] Memory problem with ST_Within

Frank Koormann frank.koormann at intevation.de
Wed Aug 20 08:49:56 PDT 2008


* Birgit Laggner <birgit.laggner at vti.bund.de> [080820 17:30]:
> Here is my query:
>
> SELECT
> polygon_id,
> count(hoehe) as hoehe_count,
> min(hoehe) as hoehe_min,
> max(hoehe) as hoehe_max,
> avg(hoehe) as hoehe_avg,
> count(neigung) as neig_count,
> min(neigung) as neig_min,
> max(neigung) as neig_max,
> avg(neigung) as neig_avg,
> count(exposition) as expos_count,
> min(exposition) as expos_min,
> max(exposition) as expos_max,
> avg(exposition) as expos_avg,
> p.the_geom
> FROM bfn.ni_hoehendaten h, bfn.ni_polygone2 p
> WHERE ST_Within(h.the_geom, p.the_geom)
> GROUP BY p.polygon_id, p.the_geom
> ORDER BY p.polygon_id ASC;
>
> Does anybody know a method to reduce the memory usage? Or are there other 
> suggestions how this problem could be solved?
 
Why do you group by p.the_geom? Just a wild guess that this may cause
your memory problems. 

HTH,

        Frank

-- 
Frank Koormann    |   ++49-541-335 08 30    |   http://www.intevation.net/
Intevation GmbH, Osnabrück, DE | Commercial Register Osnabrück, HR B 18998
Managing Directors: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
PostGIS Support (http://www.intevation.net/geospatial/postgis-support.en.html)



More information about the postgis-users mailing list