PK
-
INDEX 부여와 그 이유SQL/sql 문법(mysql, mariaDB) 2024. 4. 30. 08:48
▤ 목차">HTML 삽입미리보기할 수 없는 소스 DB에서 가장 중요한 것은 탐색 속도이다.예시로는 책뒤에 단어별 색인과 비슷하다.특정 인덱스를 생성하면 해당 컬럼에 데이터들을 정렬하여 별도의 메모리 공간에 데이터의 물리적 주소와 저장된다. pk값(+ unique값)은 자동으로 인덱스가 부여된다.내가 자주 검색하는 칼럼(column)이 있다면 해당 칼럼에 인덱스를 부여해서 빠르게 검색할 수 있다. 쿼리문에 인덱스가 생성된 컬럼을 WHERE 조건으로 걸어주면 옵티마이저가 판단하여 생성된 인덱스를 사용할 수 있다. 📑 index인덱스는 의미 그대로 '색인'이다.내가 원하는 column에 인덱스 표를 부여하는 것이다.보통 하나의 테이블에는 수십 개의 column이 존재한다.database는 첫번째 colu..