**按一个 partition key 把这张巨表拆成更小的物理子表,使每次查询只触及它所需的 partition(分区裁剪,partition pruning),而不是扫描数十亿行。**一张有 50 亿订单行的表仍然表现得像一张逻辑表,但当你的 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)
