MySQL의 Using filesort와 Using temporary
·
DB
MySQL의 filesortMySQL 8.0 버전 기반으로 공식문서에는“filesort is the algorithm MySQL uses to sort results when it cannot use an index to retrieve the rows in sorted order.”MySQL 8.0 Reference Manual, 8.2.1.14 How MySQL Optimizes ORDER BY즉, 인덱스를 통해 정렬된 순서로 가져올 수 없을 때 MySQL이 사용하는 정렬 알고리즘을 의미합니다.“파일”이라는 단어 때문에 디스크에 쓰는 정렬이라고 오해하기 쉽지만, filesort는 ‘정렬 알고리즘’이며, 반드시 파일(디스크)를 쓰는 것은 아닙니다. MySQL의 정렬 방식MySQL이 조회한 데이터를 정..