]> git.openstreetmap.org Git - nominatim.git/commitdiff
increase splitting for large geometries
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 20 Aug 2020 14:37:33 +0000 (16:37 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 24 Sep 2020 09:52:17 +0000 (11:52 +0200)
When computing the address parts for a geometry, we need to do
a ST_Relates lookup in the location_area_large_* tables. This is
potentially very expensive for geometries with many vertices.
There is already a funtion for splitting large areas to reduce the
impact. This commit reduces the minimum area of a split, effectively
increasing the number of splits.

The effect on database size is minimal (around 3% increase), while
the indexing speed for streets increases by a good 60%.

sql/functions/utils.sql

index 61033fb4d3a5db50118f66fa93a6a7378c4f5660..d88de426b19cee6c7a1afb2da5b2f9e2e683f700 100644 (file)
@@ -431,7 +431,7 @@ DECLARE
   geo RECORD;
 BEGIN
   -- 10000000000 is ~~ 1x1 degree
-  FOR geo IN select quad_split_geometry(geometry, 0.25, 20) as geom LOOP
+  FOR geo IN select quad_split_geometry(geometry, 0.01, 20) as geom LOOP
     RETURN NEXT geo.geom;
   END LOOP;
   RETURN;