Hi , We are using Nominatim with following configs for geocoding (getting lat and lon) Nominatim Version 2.4.0 16 core CPUS, 122GB RAM 320GB SSD HD And our postgresql.conf looks like following shared_buffers = 1GB # min 128kB maintenance_work_mem = 10GB # min 1MB work_mem = 50MB # min 64kB maintenance_work_mem = 10GB # min 1MB effective_cache_size = 24GB synchronous_commit = off # synchronization level; checkpoint_segments = 100 # in logfile segments, min 1, 16MB each checkpoint_timeout = 10min # range 30s-1h checkpoint_completion_target = 0.9 # checkpoint target duration, 0.0 - 1.0 We are seeing following queries taking time (almost always> 5 seconds) in postgres logs for geocode http://nominatim.local.com/nominatim/search.php?format=json&limit=1&q=322+West+Street%2CCarlisle%2CMassachusetts%2C01741%2CUnited+States LOG: duration: 19915.484 ms statement: select place_id, (select count(*) from (select unnest(ARRAY[4523464,5730972,36867388]) INTERSECT select unnest(nameaddress_vector))s) as exactmatch from search_name where name_vector @> ARRAY[2832006] and array_cat(nameaddress_vector,ARRAY[]::integer[]) @> ARRAY[15678054,348921,362979,36867389] and country_code = 'us' order by (case when importance = 0 OR importance IS NULL then 0.75-(search_rank::float/40) else importance end) DESC, exactmatch DESC limit 2 LOG: duration: 13518.676 ms statement: select place_id, (select count(*) from (select unnest(ARRAY[6122619,5730972,18878827]) INTERSECT select unnest(nameaddress_vector))s) as exactmatch from search_name where name_vector @> ARRAY[2294177] and array_cat(nameaddress_vector,ARRAY[]::integer[]) @> ARRAY[1997025,53652,362979,18878828] and country_code = 'us' order by (case when importance = 0 OR importance IS NULL then 0.75-(search_rank::float/40) else importance end) DESC, exactmatch DESC limit 2 Can someone suggest what are we missing here? Anyways to improve like creating indexes or changing postgres configs? Thanks. asked 15 Nov '16, 07:46 aaphadke |
This is a duplicate of https://github.com/twain47/Nominatim/issues/578 answered 15 Nov '16, 10:57 mtmail |