[postgis-devel] ST_Envelope & spatial index

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Tue Mar 13 14:29:44 PDT 2012


Try this:

SELECT ST_Extent(rast::geometry) from raster.ofc10k_2010;

Pierre

> -----Original Message-----
> From: postgis-devel-bounces at postgis.refractions.net [mailto:postgis-devel-
> bounces at postgis.refractions.net] On Behalf Of Andrea Peri
> Sent: Tuesday, March 13, 2012 5:24 PM
> To: postgis-devel at postgis.refractions.net
> Subject: [postgis-devel] ST_Envelope & spatial index
> 
> Hi,
> 
> The raster function ST_Envelope() will use the GIST Index if existent ?
> 
> It seem to be particularly slow.
> 
> So I try to do this:
> 
> explain select ST_Extent(ST_Envelope(rast)) from raster.ofc10k_2010 limit 1;
> 
> And see that.
> 
> Limit  (cost=48027.93..48027.94 rows=1 width=32)
>   ->  Aggregate  (cost=48027.93..48027.94 rows=1 width=32)
>         ->  Seq Scan on ofc10k_2010  (cost=0.00..37419.53 rows=1414453
> width=32)
> 
> Also I verify there the GIST Index create from raster2pgsql
> 
> CREATE INDEX ofc10k_2010_rast_gist
>   ON raster.ofc10k_2010
>   USING gist
>   (st_convexhull(rast) );
> 
> --
> -----------------
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -----------------
> 




More information about the postgis-devel mailing list