[PostGIS] #5953: Slow st_intersection with big input polygons

PostGIS trac at osgeo.org
Thu Jul 31 15:09:27 PDT 2025


#5953: Slow st_intersection with big input polygons
--------------------------------+---------------------------
  Reporter:  Lars Aksel Opsahl  |      Owner:  pramsey
      Type:  enhancement        |     Status:  new
  Priority:  medium             |  Milestone:  PostGIS 3.6.0
 Component:  postgis            |    Version:  master
Resolution:                     |   Keywords:
--------------------------------+---------------------------
Comment (by mdavis):

 Another idea is to take advantage of the efficient PostGIS spatial
 relationship filtering (via prepared queries and the new RelateNG code)
 and only perform the intersection when a target polygon is not covered by
 the large polygon.  If a substantial fraction of the target polygons lie
 inside the large polygon, this might provide a speed-up.

 This will require reformulating the query so that `ST_Covers` can be used
 as the first spatial filter (and ensuring that it is able to operate in
 prepared mode).
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5953#comment:6>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list