From: Sarah Hoffmann Date: Tue, 31 Mar 2015 21:09:55 +0000 (+0200) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: deploy~469 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/00379183adaca10dbbae1c3819e8652269d49ad7 Merge remote-tracking branch 'upstream/master' Conflicts: sql/functions.sql --- 00379183adaca10dbbae1c3819e8652269d49ad7 diff --cc sql/functions.sql index afa687be,e404da7c..a5d0f6a0 --- a/sql/functions.sql +++ b/sql/functions.sql @@@ -2271,54 -2034,7 +2034,13 @@@ BEGI END IF; - -- Special case - if we are just adding extra words we hack them into the search_name table rather than reindexing - IF FALSE AND existingplacex.rank_search < 26 - AND coalesce(existing.housenumber, '') = coalesce(NEW.housenumber, '') - AND coalesce(existing.street, '') = coalesce(NEW.street, '') - AND coalesce(existing.addr_place, '') = coalesce(NEW.addr_place, '') - AND coalesce(existing.isin, '') = coalesce(NEW.isin, '') - AND coalesce(existing.postcode, '') = coalesce(NEW.postcode, '') - AND coalesce(existing.country_code, '') = coalesce(NEW.country_code, '') - AND coalesce(existing.name::text, '') != coalesce(NEW.name::text, '') - THEN - - IF NOT update_location_nameonly(existingplacex.place_id, NEW.name) THEN - - IF st_area(NEW.geometry) < 0.5 THEN - UPDATE placex set indexed_status = 2 from place_addressline where address_place_id = existingplacex.place_id - and placex.place_id = place_addressline.place_id and indexed_status = 0 - and (rank_search < 28 or name is not null); - END IF; - - END IF; - - ELSE - - -- Anything else has changed - reindex the lot - IF coalesce(existing.name::text, '') != coalesce(NEW.name::text, '') - OR coalesce(existing.housenumber, '') != coalesce(NEW.housenumber, '') - OR coalesce(existing.street, '') != coalesce(NEW.street, '') - OR coalesce(existing.addr_place, '') != coalesce(NEW.addr_place, '') - OR coalesce(existing.isin, '') != coalesce(NEW.isin, '') - OR coalesce(existing.postcode, '') != coalesce(NEW.postcode, '') - OR coalesce(existing.country_code, '') != coalesce(NEW.country_code, '') THEN - - -- performance, can't take the load of re-indexing a whole country / huge area - IF st_area(NEW.geometry) < 0.5 THEN - -- UPDATE placex set indexed_status = 2 from place_addressline where address_place_id = existingplacex.place_id - -- and placex.place_id = place_addressline.place_id and indexed_status = 0; - END IF; - - END IF; - - 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, '')