mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
use SP-GIST index for building index where available
Point-in-polygon queries are much faster with a SP-GIST geometry index, so use that for the index used to check if a housenumber is inside a building. Only available with Postgis 3. There is an automatic fallback to GIST for Postgis 2.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user