반응형
공간 테이블 geometry 컬럼 gist 인덱스 설정되어 있는 상태
st_equals 함수 사용하면 속도가 너무 느림. 공간 인덱스 안타는 것 같음
느린 쿼리문
SELECT t1.geom, t2.geom
FROM table_a t1 join table_a t2
ON st_equals(t1.geom, t2.geom)
인덱스 타도록 쿼리문 수정
반응형
SELECT t1.geom, t2.geom
FROM table_a t1 join table_a t2
ON (st_equals(t1.geom, t2.geom) and t1.geom && t2.geom)
위 쿼리문 테스트 결과 인덱스 잘 탐
반응형
'PostGIS' 카테고리의 다른 글
[PostGIS] 좌표계 변환 함수(ST_Transform, ST_SetSRID) (0) | 2022.06.29 |
---|---|
[PostGIS] ST_CollectionExtract (0) | 2022.05.31 |
[PostGIS] geosintersects topologyexception 발생 시 대처 방법 (0) | 2022.05.27 |
[PostGIS] Polygon 단위로 겹치는 Geometry 조회 (0) | 2022.05.27 |
[postgresql] postGIS 공간 쿼리 함수 (0) | 2022.05.27 |