<div dir="ltr">I published a Postgis-raster table as a Mapserver WCS layer using gdal-1.10dev driver. I'm getting the expected result as output of my Getcoverage query but I'm concerned by the time required to extract the data. It takes about 3 minutes to extract a 4800 x 4800 pixels area. I looked at the SQL queries performed against the database during data processing and found that the GDAL driver execute a query in order to get the extent of my layer using the following SQL query:<div>
<br></div><div><div style="font-family:Arial;font-size:16px"><font><span style="font-size:10pt">select srid, nbband, st_xmin(geom) as xmin, st_xmax(geom) as xmax, st_ymin(geom) as ymin, st_ymax(geom) as ymax</span></font></div>
<div style="font-family:Arial;font-size:16px"><font><span style="font-size:10pt">from (select st_srid(rast) srid, st_extent(rast::geometry) geom, max(ST_NumBands(rast)) nbband from mib_postgis.gridcoverage_</span></font></div>
<div style="font-family:Arial;font-size:16px"><font><span style="font-size:10pt">cdsm75 group by st_srid(rast)) foo;</span></font></div><div style="font-family:Arial;font-size:16px"><font><span style="font-size:10pt"><br>
</span></font></div><div style="font-family:Arial;font-size:16px"><span style="font-size:10pt">srid | nbband |       xmin        |       xmax        |       ymin       |       ymax</span><br></div><div style="font-family:Arial;font-size:16px">
<font><span style="font-size:10pt">------+--------+-------------------+-------------------+------------------+------------------</span></font></div><div style="font-family:Arial;font-size:16px"><font><span style="font-size:10pt">4617 |      1 | -139.500104166667 | -52.0001041666667 | 41.5001041666667 | 60.0001041666667</span></font></div>
<div style="font-family:Arial;font-size:16px"><font><span style="font-size:10pt">(1 row)</span></font></div><div style="font-family:Arial;font-size:16px"><span style="font-size:10pt"> </span><br></div><div style="font-family:Arial;font-size:16px">
<font><span style="font-size:10pt">Time: 153033.599 ms</span></font></div></div><div><br></div><div style>I'm wondering how I could avoid this SQL to be performed on each call, since it is consuming a large amount of the request processing time and values are always the same.</div>
<div style><br></div><div style>Is it something that could be fixed at database level or into my mapfile. See the my current mapfile layer definition:</div><div style><br></div><div style><div style="font-family:Arial;font-size:13px">
LAYER</div><div style="font-family:Arial;font-size:13px">    NAME cdsm</div><div style="font-family:Arial;font-size:13px">    GROUP cdsm</div><div style="font-family:Arial;font-size:13px">    METADATA</div><div style="font-family:Arial;font-size:13px">
      "wcs_label"           "cdsm"  ### required</div><div style="font-family:Arial;font-size:13px">      "wcs_rangeset_name"   "Range 1"    ### required to support DescribeCoverage request</div>
<div style="font-family:Arial;font-size:13px">      "wcs_rangeset_label"  "My Label"   ### required to support DescribeCoverage request</div><div style="font-family:Arial;font-size:13px">      "wcs_extent" "-139.500104166667 41.5001041666667 -52.0001041666667 60.0001041666667"</div>
<div style="font-family:Arial;font-size:13px">      "wcs_resolution" "0.000208333333333 0.000208333333333"</div><div style="font-family:Arial;font-size:13px">    END</div><div style="font-family:Arial;font-size:13px">
    TYPE RASTER</div><div style="font-family:Arial;font-size:13px">    STATUS ON</div><div style="font-family:Arial;font-size:13px">    PROCESSING "NODATA=255"</div><div style="font-family:Arial;font-size:13px">
    DATA "PG:host=hostname port=portnumber dbname='dbname' user='username' password='passwd' schema='schema' table='gridcoverage_cdsm75' mode='2'"</div><div style="font-family:Arial;font-size:13px">
    PROJECTION</div><div style="font-family:Arial;font-size:13px">        "init=epsg:4617"</div><div style="font-family:Arial;font-size:13px">    END</div><div style="font-family:Arial;font-size:13px">  END</div>
</div><div style><br></div><div style>Thanks,</div><div style><br></div><div style>J-F</div></div>