가장 많이 묻는 면접 질문과 답변 & 온라인 테스트
면접 준비, 온라인 테스트, 튜토리얼, 라이브 연습을 위한 학습 플랫폼

집중 학습 경로, 모의고사, 면접 준비 콘텐츠로 실력을 키우세요.

WithoutBook은 주제별 면접 질문, 온라인 연습 테스트, 튜토리얼, 비교 가이드를 하나의 반응형 학습 공간으로 제공합니다.

Chapter 8

Indexes, Compound Indexes, Text Search, Geospatial Indexes, and Performance Basics

Learn how MongoDB indexing works and why performance depends heavily on matching indexes to real query patterns.

Inside this chapter

  1. Why Indexes Matter
  2. Simple and Compound Indexes
  3. Specialized Index Types
  4. Index Tradeoffs

Series navigation

Study the chapters in order for the clearest path from MongoDB basics to advanced document modeling and production operations. Use the navigation at the bottom of each page to move through the full series.

Tutorial Home

Chapter 8

Why Indexes Matter

A query that feels fast with a few hundred documents can become very slow with millions if MongoDB must scan too much data. Indexes help the database locate relevant documents faster for filtering and sorting operations.

Chapter 8

Simple and Compound Indexes

db.orders.createIndex({ customerId: 1 })
db.orders.createIndex({ customerId: 1, createdAt: -1 })

A simple index supports filtering on one field. A compound index supports combined query and sort patterns more efficiently when ordered well.

Chapter 8

Specialized Index Types

MongoDB also supports text indexes for text search scenarios and geospatial indexes for location-aware queries. These extend MongoDB beyond simple key-based lookups and make it more useful for specialized application workloads.

Chapter 8

Index Tradeoffs

Indexes improve reads but consume storage and can slow writes. Strong index design comes from measuring actual workload patterns rather than creating many indexes blindly.

Copyright © 2026, WithoutBook.