안녕하세요 초보자 입니다. 다름이 아니오라 postgres에서 index를 거는데 다음과 같이 했습니다.
CREATE INDEX address2_fid_index ON addressinfo2 (fid);
CREATE INDEX address2_do_index ON addressinfo2 (do_str);
CREATE INDEX address2_city_index ON addressinfo2 (city);
CREATE INDEX address2_gu_index ON addressinfo2 (gu);
CREATE INDEX address2_dong_index ON addressinfo2 (dong);
CREATE INDEX address2_bungi_index ON addressinfo2 (bungi);
CREATE INDEX address2_ho_index ON addressinfo2 (ho);
select * from addressinfo2 where do_str = '광주광역시' and gu='광산구' and dong ='삼거동' and bungi='619' and ho='';
그런데 속도가 무지 오래걸리 더군요..--; 인덱스 안건거하고 똑같이.--;
그래서 이번엔.
CREATE INDEX address2_do_index ON addressinfo2 (do_str,city,gu,dong,bungi,ho); 이런식으로 한번 더 걸어주었습니다.
그래도 마찬가지던데요..--; 물론 where 조건절에 단항식 그러니깐 do_str='광주광역시' 이런식으로만 걸어주면 무지 빨랐습니다.--;
어떻게 하면 될까요???
참고로 레코드 370만건 입니다..
|