Wednesday, 31 August 2016

postgresql - How to fix performance problem in PostGIS ST_Intersects?


I'm a newbie in postgis and I have a problem in query performance.


This my query:


SELECT DISTINCT ON (userid) userid ,ST_AsText(position), timestamp  

FROM table1
WHERE ST_Intersects ( ST_GeomFromText('a multiypolygon geom goes here',4326),position)
ORDER BY userid, timestamp desc

and the problem is my multipolygon include VERY large polygons (600 pages long in word doc!) and it took more than 2 hours to execute!


Is there a way to optimize my query or use another way?


Please your help is greatly appreciated!




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...