]> git.openstreetmap.org Git - nominatim.git/commitdiff
remove unused location_property_-partion- tables
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 23 Apr 2016 08:07:57 +0000 (10:07 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 23 Apr 2016 08:07:57 +0000 (10:07 +0200)
sql/indices.src.sql
sql/partition-tables.src.sql
tests/steps/terrain.py
utils/setup.php

index 73ba662b17bfed4eafb2abae4310e6782b4ceded..5ee621df94c1a2b1f87fc57d2a9713279e97eed6 100644 (file)
@@ -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};
 
index 3f400c65d582537a4dba18a05e296e4ba553ac07..3e32474fa931459d99b9a67e086bcf4b0f2897e1 100644 (file)
@@ -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,
index 39fc662593c8d9f2fe78d34efc76300d1d418aca..0a4495e01217b8ef3c36cb0275d04dcc9d294849 100644 (file)
@@ -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
index 4a2bc64ff3a8e7d3919f9fbb62452ee4b3894b05..f18556738b6c698438862136e0bedf859e661784 100755 (executable)
        {
                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}',
                                                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);
        }