You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
인덱스
💡 인덱스란 추가적인 쓰기 작업과 저장 공간을 활용하여 데이터베이스 테이블의 검색 속도를 향상시키기 위한 자료구조이다.
DB에서 인덱스가 필요한 이유
예를 들어서, 아래와 같은 데이터가 있다면 age = 20인걸 찾으려면?
→ 모든 행을 다 찾아야한다. 그렇다면 데이터가 1억개 정도가 있다면?
→ 1억개의 행을 다 뒤져야한다.
B-트리
💡 인덱스를 실제로 구현하는데 있어 대부분의 데이터베이스들은 트리 형태로 인덱스를 생성해놓는다.
ex) 14라는 key를 찾아야한다면?
Balanced tree를 사용하는 이유는??
인덱스 생성하기
MySQL
MongoDB
인덱스 최적화 기법
1. 인덱스는 비용
읽기 비용이 발생한다.
균형 있는 트리를 조절하기 위한 비용도 든다
인덱스의 단점
2. 항상 테스팅해라
3. 복합 인덱스는 같음, 다중 값, 카디널리티 순서
Beta Was this translation helpful? Give feedback.
All reactions