From: Sarah Hoffmann Date: Tue, 12 Apr 2016 21:00:24 +0000 (+0200) Subject: Merge pull request #425 from lonvia/disable-aux-tables X-Git-Tag: v3.0.0~180 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/d01d0c13f4d51ddcff2be065f330278516c0c458?ds=sidebyside;hp=-c Merge pull request #425 from lonvia/disable-aux-tables make tables for external data (Tiger and aux) configurable --- d01d0c13f4d51ddcff2be065f330278516c0c458 diff --combined settings/settings.php index 33cfa3f2,266ff356..d44bb967 --- a/settings/settings.php +++ b/settings/settings.php @@@ -13,6 -13,16 +13,16 @@@ @define('CONST_Limit_Reindexing', true); // Set to false to avoid importing extra postcodes for the US. @define('CONST_Use_Extra_US_Postcodes', true); + // Set to true after importing Tiger house number data for the US. + // Note: The tables must already exist or queries will throw errors. + // After changing this setting run ./utils/setup --create-functions + // again. + @define('CONST_Use_US_Tiger_Data', false); + // Set to true after importing other external house number data. + // Note: the aux tables must already exist or queries will throw errors. + // After changing this setting run ./utils/setup --create-functions + // again. + @define('CONST_Use_Aux_Location_data', false); // Proxy settings @define('CONST_HTTP_Proxy', false); @@@ -112,10 -122,10 +122,10 @@@ @define('CONST_PolygonOutput_MaximumTypes', 1); // Log settings - @define('CONST_Log_DB', true); + // Set to true to log into new_query_log table. + // You should set up a cron job that regularly clears out this table. + @define('CONST_Log_DB', false); + // Set to a file name to enable logging to a file. @define('CONST_Log_File', false); - @define('CONST_Log_File_Format', 'TODO'); // Currently hard coded - @define('CONST_Log_File_SearchLog', ''); - @define('CONST_Log_File_ReverseLog', ''); diff --combined sql/tables.sql index f99e78f5,49338c4a..bcc3eec1 --- a/sql/tables.sql +++ b/sql/tables.sql @@@ -13,6 -13,29 +13,6 @@@ CREATE TABLE import_osmosis_log event text ); -drop table if exists import_npi_log; -CREATE TABLE import_npi_log ( - npiid integer, - batchend timestamp, - batchsize integer, - starttime timestamp, - endtime timestamp, - event text - ); - ---drop table IF EXISTS query_log; -CREATE TABLE query_log ( - starttime timestamp, - query text, - ipaddress text, - endtime timestamp, - results integer - ); -CREATE INDEX idx_query_log ON query_log USING BTREE (starttime); -GRANT SELECT ON query_log TO "{www-user}" ; -GRANT INSERT ON query_log TO "{www-user}" ; -GRANT UPDATE ON query_log TO "{www-user}" ; - CREATE TABLE new_query_log ( type text, starttime timestamp, @@@ -20,7 -43,6 +20,7 @@@ useragent text, language text, query text, + searchterm text, endtime timestamp, results integer, format text, @@@ -34,6 -56,9 +34,6 @@@ GRANT SELECT ON new_query_log TO "{www- GRANT SELECT ON TABLE country_name TO "{www-user}"; GRANT SELECT ON TABLE gb_postcode TO "{www-user}"; -create view vw_search_query_log as SELECT substr(query, 1, 50) AS query, starttime, endtime - starttime AS duration, substr(useragent, 1, 20) as -useragent, language, results, ipaddress FROM new_query_log WHERE type = 'search' ORDER BY starttime DESC; - drop table IF EXISTS word; CREATE TABLE word ( word_id INTEGER, @@@ -75,15 -100,6 +75,6 @@@ CREATE TABLE location_property ); SELECT AddGeometryColumn('location_property', 'centroid', 4326, 'POINT', 2); - CREATE TABLE location_property_aux () INHERITS (location_property); - CREATE INDEX idx_location_property_aux_place_id ON location_property_aux USING BTREE (place_id); - CREATE INDEX idx_location_property_aux_parent_place_id ON location_property_aux USING BTREE (parent_place_id); - CREATE INDEX idx_location_property_aux_housenumber_parent_place_id ON location_property_aux USING BTREE (parent_place_id, housenumber); - GRANT SELECT ON location_property_aux TO "{www-user}"; - - CREATE TABLE location_property_tiger (linegeo GEOMETRY, place_id BIGINT, partition INTEGER, parent_place_id BIGINT, startnumber INTEGER, endnumber INTEGER, interpolationtype TEXT, postcode TEXT); - GRANT SELECT ON location_property_tiger TO "{www-user}"; - drop table IF EXISTS search_name; CREATE TABLE search_name ( place_id BIGINT,