fix: 해구 조회 ST_Contains 제거 — 바운딩 박스 조인으로 간소화
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
부모
6b1d5f3479
커밋
61ec36c74a
@ -103,18 +103,18 @@ public class MonitoringController {
|
||||
JOIN signal.t_ais_position a
|
||||
ON a.lat BETWEEN h.min_lat AND h.max_lat
|
||||
AND a.lon BETWEEN h.min_lon AND h.max_lon
|
||||
AND public.ST_Contains(h.geom, a.geom)
|
||||
WHERE a.last_update > NOW() - INTERVAL '30 minutes'
|
||||
GROUP BY h.haegu_no, h.min_lat, h.min_lon, h.max_lat, h.max_lon,
|
||||
h.center_lon, h.center_lat, h.geom
|
||||
h.center_lon, h.center_lat
|
||||
HAVING COUNT(DISTINCT a.mmsi) > 0
|
||||
ORDER BY current_vessels DESC
|
||||
LIMIT 50
|
||||
""";
|
||||
|
||||
try {
|
||||
long start = System.currentTimeMillis();
|
||||
List<Map<String, Object>> result = queryJdbcTemplate.queryForList(sql);
|
||||
log.info("Haegu realtime query returned {} rows", result.size());
|
||||
log.info("Haegu realtime query: {} rows in {}ms", result.size(), System.currentTimeMillis() - start);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to get realtime haegu status: {}", e.getMessage(), e);
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user