]> git.openstreetmap.org Git - nominatim.git/commitdiff
support tablespaces for special phrase table
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 28 Dec 2014 22:10:10 +0000 (23:10 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 28 Dec 2014 22:10:10 +0000 (23:10 +0100)
settings/settings.php
utils/specialphrases.php

index 1b5422f9d641699b48ff0524e0c93d8283f2191a..d2621ae383cfc65ee2d520985f509e329554815e 100644 (file)
@@ -35,7 +35,7 @@
        // search tables - needed for lookups
        @define('CONST_Tablespace_Search_Data', false);
        @define('CONST_Tablespace_Search_Index', false);
-       // additional data, e.g. TIGER data - needed for lookups
+       // additional data, e.g. TIGER data, type searches - needed for lookups
        @define('CONST_Tablespace_Aux_Data', false);
        @define('CONST_Tablespace_Aux_Index', false);
 
index f1a0d0d078035c75d4168922f2e9612cc7516592..13480695d5b806b69c6c9861b58e3991e208f20d 100755 (executable)
 
                foreach($aPairs as $aPair)
                {
-                       echo "create table place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])." as ";
-                       echo "select place_id as place_id,st_centroid(geometry) as centroid from placex where ";
-                       echo "class = '".pg_escape_string($aPair[0])."' and type = '".pg_escape_string($aPair[1])."';\n";
+                       echo "create table place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1]);
+                       if (CONST_Tablespace_Aux_Data)
+                               echo " tablespace ".CONST_Tablespace_Aux_Data;
+                       echo " as select place_id as place_id,st_centroid(geometry) as centroid from placex where ";
+                       echo "class = '".pg_escape_string($aPair[0])."' and type = '".pg_escape_string($aPair[1])."'";
+                       echo ";\n";
 
                        echo "CREATE INDEX idx_place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])."_centroid ";
-                       echo "ON place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])." USING GIST (centroid);\n";
+                       echo "ON place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])." USING GIST (centroid)";
+                       if (CONST_Tablespace_Aux_Index)
+                               echo " tablespace ".CONST_Tablespace_Aux_Index;
+                       echo ";\n";
 
                        echo "CREATE INDEX idx_place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])."_place_id ";
-                       echo "ON place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])." USING btree(place_id);\n";
+                       echo "ON place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])." USING btree(place_id)";
+                       if (CONST_Tablespace_Aux_Index)
+                               echo " tablespace ".CONST_Tablespace_Aux_Index;
+                       echo ";\n";
 
-            echo "GRANT SELECT ON place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])." TO \"www-data\";";
+            echo "GRANT SELECT ON place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])." TO \"www-data\";\n";
 
                }