<div dir="ltr">Do you need the maximum extent constraint? Generally, it is safe to disable the maximum extent constraint.<div><br></div><div>-bborie</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 27, 2014 at 7:06 AM, Eloi Ribeiro <span dir="ltr"><<a href="mailto:eloi@openmailbox.org" target="_blank">eloi@openmailbox.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 2014-02-27 11:19, Rémi Cura wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Maybe you can try to separate raster2pgsql and psql .<br>
<br>
First use raster2pgsqland output it to a file on you filesystem.<br>
Then use psql<br>
to execute this file.<br>
<br>
You could see how much time each step takes, and how much space the<br>
sql temp file is.<br>
</blockquote></blockquote>
<br></div>
The sql file went up to 6.6 GB.<div class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Maybe you could use the "-Y" flag to make it faster?<br>
</blockquote></blockquote>
<br></div>
(...)<br>
INSERT 0 1<br>
INSERT 0 1<br>
INSERT 0 1<br>
<br>
# Til here with the -Y flag was much faster, jumped from 1h 30 min to only 13 min.<br>
<br>
CREATE INDEX<br>
ANALYZE<br>
psql:/home/eloi/Documents/cec_<u></u>l_b1i.sql:37324808: NOTICE: Adding SRID constraint<br>
CONTEXT: PL/pgSQL function "addrasterconstraints" line 53 at RETURN<br>
psql:/home/eloi/Documents/cec_<u></u>l_b1i.sql:37324808: NOTICE: Adding scale-X constraint<br>
CONTEXT: PL/pgSQL function "addrasterconstraints" line 53 at RETURN<br>
psql:/home/eloi/Documents/cec_<u></u>l_b1i.sql:37324808: NOTICE: Adding scale-Y constraint<br>
CONTEXT: PL/pgSQL function "addrasterconstraints" line 53 at RETURN<br>
psql:/home/eloi/Documents/cec_<u></u>l_b1i.sql:37324808: NOTICE: Adding blocksize-X constraint<br>
CONTEXT: PL/pgSQL function "addrasterconstraints" line 53 at RETURN<br>
psql:/home/eloi/Documents/cec_<u></u>l_b1i.sql:37324808: NOTICE: Adding blocksize-Y constraint<br>
CONTEXT: PL/pgSQL function "addrasterconstraints" line 53 at RETURN<br>
psql:/home/eloi/Documents/cec_<u></u>l_b1i.sql:37324808: NOTICE: Adding alignment constraint<br>
CONTEXT: PL/pgSQL function "addrasterconstraints" line 53 at RETURN<br>
psql:/home/eloi/Documents/cec_<u></u>l_b1i.sql:37324808: NOTICE: Adding number of bands constraint<br>
CONTEXT: PL/pgSQL function "addrasterconstraints" line 53 at RETURN<br>
psql:/home/eloi/Documents/cec_<u></u>l_b1i.sql:37324808: NOTICE: Adding pixel type constraint<br>
CONTEXT: PL/pgSQL function "addrasterconstraints" line 53 at RETURN<br>
psql:/home/eloi/Documents/cec_<u></u>l_b1i.sql:37324808: NOTICE: Adding nodata value constraint<br>
CONTEXT: PL/pgSQL function "addrasterconstraints" line 53 at RETURN<br>
psql:/home/eloi/Documents/cec_<u></u>l_b1i.sql:37324808: NOTICE: Adding out-of-database constraint<br>
CONTEXT: PL/pgSQL function "addrasterconstraints" line 53 at RETURN<br>
<br>
# Til here took about 30 minutes. And from here starts the slow part.<br>
<br>
psql:/home/eloi/Documents/cec_<u></u>l_b1i.sql:37324808: NOTICE: Unable to get the extent of a sample raster. Attempting memory efficient (slower) approach<br>
CONTEXT: PL/pgSQL function "addrasterconstraints" line 100 at assignment<br>
PL/pgSQL function "addrasterconstraints" line 53 at RETURN<br>
<br>
# 3h 30min have passed and still the same.<br>
<br>
The message is clear and searching for this message I came across with the code I think is executing [1].<br>
There I can see that when this notice is raised it try again with function 'st_memunion' (memory friendly but slower) after failing with 'st_collect'.<br>
The machine where I am running this has 16 GB RAM and even so it was not able to preform this task with 'st_collect'.<br>
<br>
Any suggestions?<br>
<br>
Thanks.<br>
<br>
Cheers,<br>
<br>
Eloi Ribeiro<br>
<br>
[1] <a href="https://git.osgeo.org/postgis/tags/2.0.3/raster/rt_pg/rtpostgis.sql.in.c" target="_blank">https://git.osgeo.org/postgis/<u></u>tags/2.0.3/raster/rt_pg/<u></u>rtpostgis.sql.in.c</a><div class="HOEnZb"><div class="h5">
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-<u></u>bin/mailman/listinfo/postgis-<u></u>users</a></div></div></blockquote></div><br></div>