[postgis-users] CPU tuning

Marcone marconeperes at gmail.com
Mon Jan 9 06:31:26 PST 2017


2017-01-09 12:21 GMT-02:00 RĂ©mi Cura <remi.cura at gmail.com>:

> postgres 9.4 is non-parallelised, what you see is that postgres use 100%
> of a core, but the core beig used is rotated,
> which mean the average usage of your cpu is 100% / 4 (your number of core),
> which might be the explaination for your 30%.
>

Exactly! I was write something like this.

Please, try the query:

FOR row in
SELECT DISTINCT ON (t_x.code, t_y.code)
t_x.code,
t_y.code,
ST_Distance(t_x.geom, t_y.geom)
FROM t_x, t_y
ORDER BY t_x.code,
t_y.code,
ST_Distance(t_x.geom, t_y.geom)
LOOP
-- Do something here
END LOOP;

The query above use less conversions, may be more efficient.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20170109/001940d5/attachment.html>


More information about the postgis-users mailing list