]> granicus.if.org Git - postgis/commitdiff
topology: create an index on edge.left_face and edge.right_face, speeding up construc...
authorSandro Santilli <strk@keybit.net>
Tue, 15 Feb 2011 08:26:37 +0000 (08:26 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 15 Feb 2011 08:26:37 +0000 (08:26 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@6822 b70326c6-7e19-0410-871a-916f4a2858ee

topology/topology.sql.in.c

index 8c88a4843082e27cea592a4d1de3e3d95027b6f1..293abfd78fa3a2c6df3a98a03f293edb636106b5 100644 (file)
@@ -1807,6 +1807,17 @@ CREATE SCHEMA '' || quote_ident(atopology) || '';
                || quote_ident(atopology)
                || ''.edge_data using gist (geom gist_geometry_ops);'';
 
+       ------- Indexes on left_face and right_face of edge_data
+       ------- NOTE: these indexes speed up GetFaceGeometry (and thus
+       -------       TopoGeometry::Geometry) by a factor of 10 !
+       -------       See http://trac.osgeo.org/postgis/ticket/806
+       EXECUTE ''CREATE INDEX edge_left_face_idx ON ''
+               || quote_ident(atopology)
+               || ''.edge_data (left_face);'';
+       EXECUTE ''CREATE INDEX edge_right_face_idx ON ''
+               || quote_ident(atopology)
+               || ''.edge_data (right_face);'';
+
        ------- Add record to the "topology" metadata table
        EXECUTE ''INSERT INTO topology.topology (id, name, srid, precision) ''
                || '' VALUES ('' || quote_literal(topology_id) || '',''