이번에 비교적 자료량이 많고 복잡한 쿼리를 많은 시스템을 설계하고 있습니다.
계속 튜닝을 하는데요. index를 쓰면 훨씬 빠르게 끝나는 쿼리를 자꾸 seq scan을 사용하느라고 빨리 처리하지 못하네요.
제가 pgsql query planer에게 불만인 것이 너무 자주 index scan과 nested loop 대신에 seq scan과 hash join을 사용한다는 것입니다.
이번에는 너무 속도에 민감한 상황이고 random_page_cost를 2까지 줄여도 index를 사용할 생각을 안하기에 enable_seqscan을 false로 고정해 볼까 생각하고 있습니다.
혹시 이렇게 설정해 놓고 운영하시는 분 계신지요. 추천까지는 아니더라도 많이들 이렇게 사용한다고 mailing list에서 본 것 같아서요.
|