ਵਿਸ਼ਾਲ table ਨੂੰ ਇੱਕ partition key ਨਾਲ ਛੋਟੀਆਂ physical child tables ਵਿੱਚ ਵੰਡੋ, ਤਾਂ ਜੋ ਹਰ query ਸਿਰਫ਼ ਉਹਨਾਂ partitions ਨੂੰ ਛੂਹੇ ਜਿਨ੍ਹਾਂ ਦੀ ਇਸਨੂੰ ਲੋੜ ਹੈ (partition pruning) ਨਾ ਕਿ ਅਰਬਾਂ rows scan ਕਰੇ। 5B order rows ਵਾਲੀ ਇੱਕ table ਅਜੇ ਵੀ ਇੱਕ logical table ਵਾਂਗ ਵਿਹਾਰ ਕਰਦੀ ਹੈ, ਪਰ engine ਇਸਦਾ 99% skip ਕਰ ਦਿੰਦਾ ਹੈ ਜਦੋਂ ਤੁਹਾਡਾ WHERE partition key ਉੱਤੇ filter ਕਰਦਾ ਹੈ।
ਇੱਕ 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)
