From: Sandro Santilli Date: Mon, 5 Nov 2012 10:27:08 +0000 (+0000) Subject: Create indices on start_node and end_node of edge_data (#2082) X-Git-Tag: 2.1.0beta2~413 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d42054844e96922e58597ca5a23f78e9c049bb96;p=postgis Create indices on start_node and end_node of edge_data (#2082) Those indices speed up nodes deletion by a factor of x1000 ! I didn't profile, but I suspect those indices would also speed up ring walking (whereas you have to find a match between endnodes). git-svn-id: http://svn.osgeo.org/postgis/trunk@10644 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/topology/topology.sql.in.c b/topology/topology.sql.in.c index b8e67ffe2..09a88c078 100644 --- a/topology/topology.sql.in.c +++ b/topology/topology.sql.in.c @@ -1855,6 +1855,19 @@ BEGIN || quote_ident(atopology) || '.edge_data (right_face);'; + ------- Indexes on start_node and end_node of edge_data + ------- NOTE: this indexes speed up node deletion + ------- by a factor of 1000 ! + ------- See http://trac.osgeo.org/postgis/ticket/2082 + EXECUTE 'CREATE INDEX edge_start_node_idx ON ' + || quote_ident(atopology) + || '.edge_data (start_node);'; + EXECUTE 'CREATE INDEX edge_end_node_idx ON ' + || quote_ident(atopology) + || '.edge_data (end_node);'; + + -- TODO: consider also adding an index on node.containing_face + ------- Add record to the "topology" metadata table EXECUTE 'INSERT INTO topology.topology ' || '(id, name, srid, precision, hasZ) VALUES ('