[postgis-users] My slope calculation is too slow

Ahmet Temiz ahmettemiz88 at gmail.com
Wed May 27 00:31:19 PDT 2015


thank you ( Rémi ),

Good support. I had never known "MATERIAL VIEW".

regards

On Tue, May 26, 2015 at 1:43 PM, Rémi Cura <remi.cura at gmail.com> wrote:

> Hey,
> ​​
> first, about slow query question
> https://wiki.postgresql.org/wiki/Slow_Query_Questions
>
> Now you need to identify the problem.
> For this, you have mainly 2 tools :
>  - EXPLAIN ANALYZE (how postgres understands your query, what indexes it
> uses, etc.)
>  - postgres stats monitoring (individual function timing)
>
> Last, I suppose you are aware that with the view you defined, everytime
> you need to access it, you need to recompute it (cache may help you
> depending on the size of the result).
> If it is not the expected behaviour, use MATERIAL VIEW or TABLE (possibly
> TEMP or UNLOGGED ).
>
>
> Cheers,
> Rémi-C
>
> 2015-05-26 8:47 GMT+02:00 Ahmet Temiz <ahmettemiz88 at gmail.com>:
>
>> hello
>>
>> My slope calculation is very slow.
>> Can you advice me any better way to speed up slope calculation.
>>
>> here is the way I have used.
>> -------
>> Hibernate:
>>      CREATE VIEW vslp8 AS
>>     WITH r AS (  select
>>          ST_Transform(ST_Union(dem.rast),  32635) AS rast
>>      FROM
>>          rdem2 as dem
>>      where
>>          st_Intersects( st_transform(dem.rast, 32635) , ST_Transform(
>>  ST_GeomFromText('POLYGON((28.87774  40.44479446,28.87774
>>  40.755545,29.4603534  40.755545,29.4603534  40.44479446,28.87774
>>  40.44479446))',4326 ),32635))),
>>
>> cx AS (SELECT
>>          ST_AsRaster( sf.the_geom,  r.rast) AS rast
>>      FROM
>>          ( SELECT
>>              ST_Transform(  ST_GeomFromText('POLYGON((28.87774
>>  40.44479446,28.87774  40.755545,29.4603534  40.755545,29.4603534
>>  40.44479446,28.87774  40.44479446))',
>>              4326 ),
>>              32635) AS the_geom ) sf CROSS
>>      JOIN r )
>>  SELECT
>>              ST_Clip(ST_Slope(r.rast, 1,  cx.rast),
>>              ST_Transform( ST_GeomFromText('POLYGON((28.87774
>>  40.44479446,28.87774  40.755545,29.4603534  40.755545,29.4603534
>>  40.44479446,28.87774  40.44479446))',
>>              4326 ),  32635)) AS rast
>>          FROM
>>              r  CROSS
>>          JOIN cx
>>
>> -----
>>
>> I will appreciate if you propose any way.
>>
>> regards
>>
>> --
>> Ahmet Temiz
>> Jeoloji Müh.
>> Afet ve Acil Durum Yönetimi Başkanlığı
>> Bilgi İşlem  Dairesi Başkanlığı-CBS Grubu
>>
>>
>> ________________________
>>
>> Ahmet Temiz
>> Geological Eng.
>> Information Systems - GIS Group
>> Disaster and Emergency Management
>> of Presidency
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>



-- 
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Bilgi İşlem  Dairesi Başkanlığı-CBS Grubu


________________________

Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150527/59fbe254/attachment-0001.html>


More information about the postgis-users mailing list