mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
avoid contains operator for geometries
Postgis keeps messing up use of index in some circumstances.
This commit is contained in:
@@ -97,7 +97,7 @@ BEGIN
|
|||||||
-- Instead simply use the containing area with the largest rank.
|
-- Instead simply use the containing area with the largest rank.
|
||||||
FOR location IN
|
FOR location IN
|
||||||
SELECT place_id FROM placex
|
SELECT place_id FROM placex
|
||||||
WHERE bbox @ geometry AND _ST_Covers(geometry, ST_Centroid(bbox))
|
WHERE bbox && geometry AND _ST_Covers(geometry, ST_Centroid(bbox))
|
||||||
AND rank_address between 5 and 25
|
AND rank_address between 5 and 25
|
||||||
ORDER BY rank_address desc
|
ORDER BY rank_address desc
|
||||||
LOOP
|
LOOP
|
||||||
@@ -112,7 +112,7 @@ BEGIN
|
|||||||
-- contains the bbox, only use addressable features
|
-- contains the bbox, only use addressable features
|
||||||
FOR location IN
|
FOR location IN
|
||||||
SELECT place_id FROM placex
|
SELECT place_id FROM placex
|
||||||
WHERE bbox @ geometry AND _ST_Covers(geometry, ST_Centroid(bbox))
|
WHERE bbox && geometry AND _ST_Covers(geometry, ST_Centroid(bbox))
|
||||||
AND rank_address between 5 and 25
|
AND rank_address between 5 and 25
|
||||||
ORDER BY rank_address desc
|
ORDER BY rank_address desc
|
||||||
LOOP
|
LOOP
|
||||||
|
|||||||
Reference in New Issue
Block a user