mysql 8.0
-
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" 과정 없이 인덱스를 순서대로 읽어서 결과를 반환한다...
-
Real MySQL 8.0 2 : 인덱스책책책 책을 읽읍시다 2023. 4. 29. 00:23
인덱스 기본 인덱스를 역할별로 구분해 본다면 프라이머리 키(Primary Key)와 보조 키(세컨더리 인덱스, Secondary key)로 구분할 수 있다.프라이머리 키는 이미 잘 아는 것처럼 그 레코드를 대표하는 컬럼의 값으로 만들어진 인덱스를 의미한다. 이 컬럼(때로는 컬럼의 조합)은 테이블에서 해당 레코드를 식별할 수 있는 기준값이 되기 때문에 우리는 이를 식별자라고도 부른다. 프라이머리 키는 NULL 값을 허용하지 않으며 중복을 허용하지 않는 것이 특징이다.프라이머리 키를 제외한 나머지 모든 인덱스는 세컨더리 인덱스(Secondary Index)로 분류한다. 유니크 인덱스는 프라이머리 키와 성격이 비슷하고 프라이머리 키를 대체해서 사용할 수도 있다고 해서 대체 키라고도 하는데, 별도로 분류하기도 ..
-
Real MySql 8.0 1 : 쿼리 실행, 트랜잭션과 잠금책책책 책을 읽읍시다/프로그래밍 2023. 4. 27. 00:15
저자 : 백은빈, 이성욱들어가며 MySql 동작 원리를 자세하고 이해하기 쉽게 알려주는 책이다. 동작 원리를 이해하고 나니 백엔드 개발자로서 테이블 설계와 쿼리 작성을 어떻게 해야하는지 감이 잡혔다. 데이터를 저장하고 가공하는 백엔드 개발자에게는 반드시 읽어야할 책이다. MySql을 사용하는 개발자에게는 더할나위없이 좋고, 오라클이나 postgreSql과 같이 다른 진영에 있더라도 RDBMS를 MySql 예제를 통해 학습할 기회로 삼으면 좋다.MySql에 대해 A부터 Z까지 풀어주는 책이므로 설치, 클러스터링, 복제 등 상대적으로 관여도가 낮은(DBA에게 높은) 단원은 가볍게 읽고 넘어갔다. 개발하면서 자주 접하는 문제들 위주로 정리하였다. 다음부터는 발췌한 내용이다.04 아키텍처쿼리 실행 구조MySql..