From: Sarah Hoffmann Date: Sat, 23 Apr 2016 08:07:57 +0000 (+0200) Subject: remove unused location_property_-partion- tables X-Git-Tag: v3.0.0~176^2 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/a32f6c66b8c4c5c985f3ae71577404d76716d6e6?ds=sidebyside remove unused location_property_-partion- tables --- diff --git a/sql/indices.src.sql b/sql/indices.src.sql index 73ba662b..5ee621df 100644 --- a/sql/indices.src.sql +++ b/sql/indices.src.sql @@ -19,10 +19,6 @@ CREATE INDEX idx_location_area_country_place_id ON location_area_country USING B CREATE INDEX idx_search_name_country_centroid ON search_name_country USING GIST (centroid) {ts:address-index}; --- start -CREATE INDEX idx_location_property_-partition-_centroid ON location_property_-partition- USING GIST (centroid) {ts:address-index}; --- end - DROP INDEX IF EXISTS place_id_idx; CREATE UNIQUE INDEX idx_place_osm_unique on place using btree(osm_id,osm_type,class,type) {ts:address-index}; diff --git a/sql/partition-tables.src.sql b/sql/partition-tables.src.sql index 3f400c65..3e32474f 100644 --- a/sql/partition-tables.src.sql +++ b/sql/partition-tables.src.sql @@ -51,11 +51,6 @@ CREATE INDEX idx_search_name_-partition-_place_id ON search_name_-partition- USI CREATE INDEX idx_search_name_-partition-_centroid ON search_name_-partition- USING GIST (centroid) {ts:address-index}; CREATE INDEX idx_search_name_-partition-_name_vector ON search_name_-partition- USING GIN (name_vector) WITH (fastupdate = off) {ts:address-index}; -CREATE TABLE location_property_-partition- () INHERITS (location_property) {ts:aux-data}; -CREATE INDEX idx_location_property_-partition-_place_id ON location_property_-partition- USING BTREE (place_id) {ts:aux-index}; -CREATE INDEX idx_location_property_-partition-_parent_place_id ON location_property_-partition- USING BTREE (parent_place_id) {ts:aux-index}; -CREATE INDEX idx_location_property_-partition-_housenumber_parent_place_id ON location_property_-partition- USING BTREE (parent_place_id, housenumber) {ts:aux-index}; - CREATE TABLE location_road_-partition- ( partition integer, place_id BIGINT, diff --git a/tests/steps/terrain.py b/tests/steps/terrain.py index 39fc6625..0a4495e0 100644 --- a/tests/steps/terrain.py +++ b/tests/steps/terrain.py @@ -173,7 +173,9 @@ def db_template_setup(): psycopg2.extras.register_hstore(conn, globally=False, unicode=True) cur = conn.cursor() for table in ('gb_postcode', 'us_postcode'): - cur.execute('TRUNCATE TABLE %s' % (table,)) + cur.execute("select * from pg_tables where tablename = '%s'" % (table, )) + if cur.rowcount > 0: + cur.execute('TRUNCATE TABLE %s' % (table,)) conn.commit() conn.close() # execute osm2pgsql on an empty file to get the right tables diff --git a/utils/setup.php b/utils/setup.php index 4a2bc64f..f1855673 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -621,14 +621,6 @@ { echo "Search indices\n"; $bDidSomething = true; - $oDB =& getDB(); - $sSQL = 'select distinct partition from country_name'; - $aPartitions = $oDB->getCol($sSQL); - if (PEAR::isError($aPartitions)) - { - fail($aPartitions->getMessage()); - } - if (!$aCMDResult['no-partitions']) $aPartitions[] = 0; $sTemplate = file_get_contents(CONST_BasePath.'/sql/indices.src.sql'); $sTemplate = replace_tablespace('{ts:address-index}', @@ -637,16 +629,6 @@ CONST_Tablespace_Search_Index, $sTemplate); $sTemplate = replace_tablespace('{ts:aux-index}', CONST_Tablespace_Aux_Index, $sTemplate); - preg_match_all('#^-- start(.*?)^-- end#ms', $sTemplate, $aMatches, PREG_SET_ORDER); - foreach($aMatches as $aMatch) - { - $sResult = ''; - foreach($aPartitions as $sPartitionName) - { - $sResult .= str_replace('-partition-', $sPartitionName, $aMatch[1]); - } - $sTemplate = str_replace($aMatch[0], $sResult, $sTemplate); - } pgsqlRunScript($sTemplate); }