]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/db/sql_preprocessor.py
use SP-GIST index for building index where available
[nominatim.git] / nominatim / db / sql_preprocessor.py
index 80b89c57b1dbfb969aeb10f6b05d8b5166507f23..a1bf5b7f1418a0d65abd1199264a892f3d74f918 100644 (file)
@@ -46,8 +46,10 @@ def _setup_postgresql_features(conn):
         depend on the database version.
     """
     pg_version = conn.server_version_tuple()
+    postgis_version = conn.postgis_version_tuple()
     return {
-        'has_index_non_key_column': pg_version >= (11, 0, 0)
+        'has_index_non_key_column': pg_version >= (11, 0, 0),
+        'spgist_geom' : 'SPGIST' if postgis_version >= (3, 0) else 'GIST'
     }
 
 class SQLPreprocessor: