我试图通过输入邮政编码来建立搜索位置。
搜索将尝试通过2个国家/地区查找邮政编码。 在特定搜索中,我收到此错误:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 13 bytes) in
这是查询:
SELECT
dest.plz,
dest.ort,
ACOS(
SIN(RADIANS(src.lat)) * SIN(RADIANS(dest.lat))
+ COS(RADIANS(src.lat)) * COS(RADIANS(dest.lat))
* COS(RADIANS(src.lon) - RADIANS(dest.lon))
) * 6380 AS distance
FROM geodb_data dest
CROSS JOIN geodb_data src
WHERE src.plz = $zipEncode
AND dest.plz <> src.plz
HAVING distance < $distanceEncode
ORDER BY distance;
我的问题是,如何优化此查询?