]> git.openstreetmap.org Git - nominatim.git/commitdiff
disable JIT and parallel processing for osm2pgsql in updates
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 28 Jun 2020 16:06:06 +0000 (18:06 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 28 Jun 2020 16:06:06 +0000 (18:06 +0200)
This is known to cause issues because of bad indexing
statistics.

utils/update.php

index d03cbed6b8e32029bdc6ccd4be353d1bb92c9ec9..9bb3388a1598a24ced032b8a03aa0607aeef3fa4 100644 (file)
@@ -55,6 +55,7 @@ date_default_timezone_set('Etc/UTC');
 
 $oDB = new Nominatim\DB();
 $oDB->connect();
+$fPostgresVersion = $oDB->getPostgresVersion();
 
 $aDSNInfo = Nominatim\DB::parseDSN(CONST_Database_DSN);
 if (!isset($aDSNInfo['port']) || !$aDSNInfo['port']) $aDSNInfo['port'] = 5432;
@@ -90,6 +91,10 @@ if (isset($aDSNInfo['password']) && $aDSNInfo['password']) {
 if (!is_null(CONST_Osm2pgsql_Flatnode_File) && CONST_Osm2pgsql_Flatnode_File) {
     $oOsm2pgsqlCmd->addParams('--flat-nodes', CONST_Osm2pgsql_Flatnode_File);
 }
+if ($fPostgresVersion >= 11.0) {
+    $oOsm2pgsqlCmd->addEnvPair('PGOPTIONS',
+                               '-c jit=off -c max_parallel_workers_per_gather=0');
+}
 
 
 $oIndexCmd = (new \Nominatim\Shell(CONST_BasePath.'/nominatim/nominatim.py'))