From: Sarah Hoffmann Date: Sun, 28 Dec 2014 22:10:10 +0000 (+0100) Subject: support tablespaces for special phrase table X-Git-Tag: v2.4.0~64 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/3db64e79136a486533730d23ef4fe854b0ec85fa?hp=d6e7bbaad9d383a4fdd5011fc0acf7ba0ff859a4 support tablespaces for special phrase table --- diff --git a/settings/settings.php b/settings/settings.php index 1b5422f9..d2621ae3 100644 --- a/settings/settings.php +++ b/settings/settings.php @@ -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); diff --git a/utils/specialphrases.php b/utils/specialphrases.php index f1a0d0d0..13480695 100755 --- a/utils/specialphrases.php +++ b/utils/specialphrases.php @@ -86,17 +86,26 @@ 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"; }