Database partitioning splits one large logical table into smaller physical pieces called partitions, typically by a date range, list of values, or hash of a key. The table still appears as a single object to queries.
Why it matters
Queries that filter on the partition key can skip irrelevant partitions entirely, which is called partition pruning. Partitioning also makes maintenance cheaper: dropping an old month of data is an instant operation instead of a huge delete. It differs from sharding, which spreads data across different servers, though the two ideas are often combined.
Example
-- PostgreSQL style
CREATE TABLE checks (
ts timestamptz NOT NULL,
site_id bigint,
response_ms int
) PARTITION BY RANGE (ts);
CREATE TABLE checks_2026_10 PARTITION OF checks
FOR VALUES FROM ('2026-10-01') TO ('2026-11-01');
Common mistakes
- Partitioning a small table, which adds overhead without benefit.
- Writing queries that do not filter on the partition key, so every partition is scanned.
- Mixing up partitioning (one server) with sharding (many servers).
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.