[postgis-tickets] [PostGIS] #3071: CLUSTER on geometry index taking forever

PostGIS trac at osgeo.org
Thu Mar 5 11:42:53 PST 2015


#3071: CLUSTER on geometry index taking forever
---------------------+------------------------------------------------------
 Reporter:  robe     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.2.0
Component:  postgis  |     Version:  trunk        
 Keywords:           |  
---------------------+------------------------------------------------------
 I'm pretty sure I've done a CLUSTER and tables bigger than this and it did
 not take this long.

 I grabbed building footprints from this
 building footprints https://data.sfgov.org/Geographic-Locations-and-
 Boundaries/Building-Footprints-Zipped-Shapefile-Format-/jezr-5bxm

 and ran:

 {{{
 shp2pgsql -D -I -t 2D building_footprint data.sfo_buildings | psql -d
 workshop_1
 }}}

 The data had a ton of self-intersections

 so Ir an this:


 {{{
 UPDATE data.sfo_buildings
 SET geom = ST_Multi(ST_MakeValid(geom))
 WHERE NOT ST_IsValid(geom);
 }}}


 which was fine, and then proceeded to cluster



 {{{
 ALTER TABLE data.sfo_buildings
   CLUSTER ON sfo_buildings_geom_idx;

 CLUSTER data.sfo_buildings;
 }}}

 I've been waiting for 10 minutes already and the table has only got 80,000
 some odd records.  Much longer than I have patience for.  I'm pretty sure
 I've done an exercise like this with many more multipolygons and it was
 way faster (under a minute)

 I'll try to reproduce with a random dataset and also with PostGIS 2.1.5

 This is running:


 {{{
 POSTGIS="2.2.0dev r13298" GEOS="3.5.0dev-CAPI-1.9.0 r4048" SFCGAL="1.0.5"
 PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.11.1, released 2014/09/24"
 LIBXML="2.7.8" LIBJSON="0.12" RASTER PostgreSQL 9.4.1, compiled by Visual
 C++ build 1800, 64-bit
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/3071>
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