X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/bcfe817212af3e863af8dd206d27868cbdd65855..a1da14921150b8432fb92ec260597cef7a7d7ceb:/lib-sql/functions/interpolation.sql?ds=inline

diff --git a/lib-sql/functions/interpolation.sql b/lib-sql/functions/interpolation.sql
index 96a105ae..fb822033 100644
--- a/lib-sql/functions/interpolation.sql
+++ b/lib-sql/functions/interpolation.sql
@@ -52,7 +52,9 @@ BEGIN
 
   IF parent_place_id is null THEN
     FOR location IN SELECT place_id FROM placex
-        WHERE ST_DWithin(geom, placex.geometry, 0.001) and placex.rank_search = 26
+        WHERE ST_DWithin(geom, placex.geometry, 0.001)
+              and placex.rank_search = 26
+              and placex.osm_type = 'W' -- needed for index selection
         ORDER BY CASE WHEN ST_GeometryType(geom) = 'ST_Line' THEN
                   (ST_distance(placex.geometry, ST_LineInterpolatePoint(geom,0))+
                   ST_distance(placex.geometry, ST_LineInterpolatePoint(geom,0.5))+
