X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/2f8a29ba39e4ca995334f2702985afa761bfffbd..fa0cf215e723401fec62a3b336a4ed8908c2bfed:/sql/functions.sql?ds=sidebyside diff --git a/sql/functions.sql b/sql/functions.sql index 3c8f16e0..1efb1899 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -2055,6 +2055,12 @@ BEGIN END IF; + -- refuse to update multiplpoygons with too many objects, too much of a performance hit + IF ST_NumGeometries(NEW.geometry) > 2000 THEN + RAISE WARNING 'Dropping update of % % because of geometry complexity.', NEW.osm_type, NEW.osm_id; + RETURN NULL; + END IF; + IF coalesce(existing.name::text, '') != coalesce(NEW.name::text, '') OR coalesce(existing.extratags::text, '') != coalesce(NEW.extratags::text, '') OR coalesce(existing.housenumber, '') != coalesce(NEW.housenumber, '')