mysql order by
-
Real MySQL 8.0 3 : 옵티마이저와 힌트 그리고 실행계획책책책 책을 읽읍시다/프로그래밍 2023. 4. 29. 23:45
09 옵티마이저와 힌트Order by 처리(Using filesort)정렬 처리 방법 쿼리에 ORDER BY가 사용되면 반드시 다음 3가지 처리 방법 중 하나로 정렬이 처리된다. 일반적으로 아래쪽에 있는 정렬 방법으로 갈수록 처리 속도는 떨어진다.정렬 처리 방법실행 계획의 Extra 컬럼 내용인덱스를 사용한 정렬별도 표기 없음조인에서 드라이빙 테이블만 정렬"Using filesort" 메세지가 표시됨조인에서 조인 결과를 임시 테이블로 저장 후 정렬"Using temporary; Using filesort" 메세지가 표시됨 먼저 옵티마이저는 정렬 처리를 위해 인덱스를 이용할 수 있을지 검토할 것이다. 인덱스를 이용할 수 있다면 별도의 "Filesort" 과정 없이 인덱스를 순서대로 읽어서 결과를 반환한다...