거대한 테이블을 partition key로 더 작은 물리적 자식 테이블로 나눠, 각 쿼리가 수십억 row를 스캔하는 대신 필요한 partition만 건드리게(partition pruning) 하십시오. 50억 주문 row를 가진 테이블도 여전히 하나의 논리 테이블처럼 동작하지만, WHERE가 partition key로 필터링하면 엔진이 그 99%를 건너뜁니다.
파티셔닝된 테이블의 형태
text
orders (logical parent)
│ partition key = created_at
┌────────────────┼────────────────┬───────────────┐
▼ ▼ ▼ ▼
orders_2024_q1 orders_2024_q2 orders_2024_q3 orders_2025_q1
(child table) (child table) (child table) (child, active)
│ │
local index local index
(per child) (per child)
