Selon Ivan Mincik <[email protected]>: 1) Create a spatial index 2) make VACUUM on that table. 3) use "SELECT count(obce.gid) FROM obce,cr WHERE obce.the_geom && cr.the_geom and ST_Touches(obce.the_geom,cr.the_geom);"
> On Wednesday 01 April 2009, Martin Landa wrote: > > Hi, > > > > I am beginning with PostGIS and I wonder about performance, e.g. > > having layer 'regions' = 'obce' (polygon) and boundary of CZ = 'cr' > > (polygon). > > > > SELECT count(obce.gid) FROM obce; > > count > > ------- > > 6361 > > (1 row) > > > > SELECT count(obce.gid) FROM obce,cr WHERE ST_Touches(obce.the_geom, > > cr.the_geom); > > count > > ------- > > 285 > > (1 row) > > > > Time: 258271.730 ms > > > > It seems to be quite long time, any hits about configuration of > > PostgreSQL, query optimalization? > Have You tried to make VACUUM on that table ? > > > > PostgreSQL 8.1.15, 1.4 USE_GEOS=1 USE_PROJ=1 USE_STATS=1 > > > > Thanks in advance, Martin > > > > > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
