]> git.openstreetmap.org Git - nominatim.git/commitdiff
make sure indexes are used
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 25 Sep 2022 12:09:45 +0000 (14:09 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 25 Sep 2022 12:09:45 +0000 (14:09 +0200)
lib-sql/functions/placex_triggers.sql

index b32cf0f531eedc6d39ef352e117a6afaa46df789..a2276f074587658b4f0b2b781f559dcce0d49cde 100644 (file)
@@ -849,7 +849,8 @@ BEGIN
       FROM placex
       WHERE osm_type = 'R' and class = 'boundary' and type = 'administrative'
             and admin_level < NEW.admin_level and admin_level > 3
-            and rank_address > 0
+            and rank_address between 1 and 25 -- for index selection
+            and ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') -- for index selection
             and geometry && NEW.centroid and _ST_Covers(geometry, NEW.centroid)
       ORDER BY admin_level desc LIMIT 1
     LOOP