# Minimal

> Data Partitioning (Minimal)

- Skill: `snoodleboot-io/minimal-13` (Agent Skill)
- Install (CLI): `npx get-skill add snoodleboot-io/minimal-13`
- Raw SKILL.md: https://api.skillmd.com/api/skills/snoodleboot-io/minimal-13/raw
- Safety review: pending (external: skill-scanner PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: snoodleboot-io (https://skillmd.com/u/snoodleboot-io)
- Updated: 2026-11-15
- Page: https://skillmd.com/skills/snoodleboot-io/minimal-13

---

# Data Partitioning (Minimal)

## Key Strategies

### Time-Based Partition
```sql
CREATE TABLE orders (
  order_id INT,
  customer_id INT,
  amount DECIMAL
) PARTITION BY RANGE (YEAR(created_at)) (
  PARTITION p2024 VALUES LESS THAN (2025),
  PARTITION p2025 VALUES LESS THAN (2026),
  PARTITION p2026 VALUES LESS THAN (2027)
);
```

Benefits: Quick date-range queries, easy archival

### Range Partition
```sql
CREATE TABLE events (
  event_id INT,
  user_id INT
) PARTITION BY RANGE (user_id) (
  PARTITION p1 VALUES LESS THAN (1000000),
  PARTITION p2 VALUES LESS THAN (2000000),
  PARTITION p3 VALUES LESS THAN (MAXVALUE)
);
```

### List Partition
```sql
PARTITION BY LIST (region) (
  PARTITION p_us VALUES IN ('US-EAST', 'US-WEST'),
  PARTITION p_eu VALUES IN ('EU-WEST', 'EU-CENTRAL'),
  PARTITION p_apac VALUES IN ('APAC-EAST', 'APAC-SOUTH')
);
```

## Query Performance
- Partition pruning: Only scan relevant partition
- 10B rows split into 10 partitions = 1B rows per partition
- Queries 10x faster

## Maintenance
- Archive old partitions (2020 data to cold storage)
- Add new partitions automatically
- Monitor partition sizes

