From: Sarah Hoffmann Date: Mon, 25 Oct 2021 15:20:42 +0000 (+0200) Subject: Merge pull request #2484 from lonvia/fix-index-use X-Git-Tag: v4.0.0~10 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/8e439d3dd9b74752594f5ff9e32f4e70b00d35ff?hp=9ebf921c53f249ced55d36bd24235fa2b2c1d038 Merge pull request #2484 from lonvia/fix-index-use Reverse: add index hints --- diff --git a/lib-php/ReverseGeocode.php b/lib-php/ReverseGeocode.php index 47e931ef..a670c623 100644 --- a/lib-php/ReverseGeocode.php +++ b/lib-php/ReverseGeocode.php @@ -111,6 +111,7 @@ class ReverseGeocode $sSQL .= ' FROM placex'; $sSQL .= ' WHERE osm_type = \'N\''; $sSQL .= ' AND country_code = \''.$sCountryCode.'\''; + $sSQL .= ' AND rank_search < 26 '; // needed to select right index $sSQL .= ' AND rank_search between 5 and ' .min(25, $iMaxRank); $sSQL .= ' AND class = \'place\' AND type != \'postcode\''; $sSQL .= ' AND name IS NOT NULL '; @@ -206,6 +207,7 @@ class ReverseGeocode // for place nodes at rank_address 16 $sSQL .= ' AND rank_search > '.$iRankSearch; $sSQL .= ' AND rank_search <= '.$iMaxRank; + $sSQL .= ' AND rank_search < 26 '; // needed to select right index $sSQL .= ' AND rank_address > 0'; $sSQL .= ' AND class = \'place\''; $sSQL .= ' AND type != \'postcode\'';