use geometry column for special phrase queries

It has an index, centroid does not.
This commit is contained in:
Sarah Hoffmann
2012-10-09 23:57:54 +02:00
parent c691217901
commit a960cf6b71

View File

@@ -729,7 +729,7 @@
else
{
$sSQL = "select place_id from placex where class='".$aSearch['sClass']."' and type='".$aSearch['sType']."'";
$sSQL .= " and st_contains($sViewboxSmallSQL, centroid)";
$sSQL .= " and st_contains($sViewboxSmallSQL, geometry)";
if ($sCountryCodesSQL) $sSQL .= " and country_code in ($sCountryCodesSQL)";
if ($sViewboxCentreSQL) $sSQL .= " order by st_distance($sViewboxCentreSQL, centroid) asc";
$sSQL .= " limit $iLimit";