<div dir="ltr"><div>Dear all,</div><div>I'm using postigis version 2.2.1, on PostgreSQL 9.2.0.</div><div><br></div><div>I loaded SRTM DEM geotiff with raster2pgsql.  </div><div>I create a query in order to retrieve the global statistics of the tiles, over only Europe zone.</div><div><br></div><div>The query is:</div><div><br></div><div>SELECT ((stats).min) as value from (SELECT ST_SummaryStatsAgg(ST_Clip(<DB_table>.rast,ST_GeomFromText(<wkt>,ST_SRID(<DB_table>.rast)),true),1,true) as stats from <DB_table>) as stats;</div><div><br></div><div>where DB_table is the table in which are the rasters and wkt is equal to 'POLYGON((-16 74,39 74,39 33,-16 33,-16 74))'.</div><div><br></div><div>The query works fine but it takes a lot of time.</div><div><br></div><div>Is there a way to speed up the query?</div><div><br></div><div>Cheers,</div><div>Matteo</div></div>