[postgis-users] Slow ST_InteriorRingN and ST_intersection (using ST_ DumpRings makes intersection 230 times faster)

Paul Ramsey pramsey at cleverelephant.ca
Wed Feb 24 02:21:48 PST 2016


Taking this a bit at a time.

On Wed, Feb 24, 2016 at 9:00 AM, Lars Aksel Opsahl <Lars.Opsahl at nibio.no> wrote:

> So I wanted extract the interior rings and do some tests on them, so tried the following command :
>
> create table sl_lop.test_a6 as
>
> SELECT ST_InteriorRingN(a.geo, generate_series(1, 52079)) as geo from sl_lop.helling_data_d1 as a where gid = 9419961;
>
>
> This fails after some minutes with the following in the log

So, this is slower than ST_DumpRings() because it causes the server to
read the really large polygon 52 thousand times. Whereas
ST_DumpRings() reads the polygon once, then spits out all the rings. I
don't know of any way to make the ST_InteriorRingN() more efficient. I
also don't think it should crash, it should just take a very long
time.

P.


More information about the postgis-users mailing list