વિશાળ table ને partition key વડે નાના physical child tables માં split કરો, જેથી દરેક query અબજો rows scan કરવાને બદલે માત્ર જરૂરી partitions ને સ્પર્શે (partition pruning). 5B order rows વાળું table હજુ એક logical table જેવું વર્તે છે, પણ જ્યારે તમારો WHERE partition key પર filter કરે ત્યારે engine તેના 99% ને skip કરે છે.
partitioned table નો આકાર
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)
