Table Partitioning

Decide whether to partition a large PostgreSQL or MySQL table, and do it without an outage. Gate on a named reason (retention by dropping a partition, pruning on a column in nearly every query, or per-partition maintenance); a table that fits in memory with no retention need stays whole. Verify pruning on the top five real queries with EXPLAIN. Check the constraint cost (unique keys must contain the partition key, MySQL forbids foreign keys), create partitions ahead, alarm on the default. Convert live with a NOT VALID then VALIDATE CHECK before attaching; DETACH CONCURRENTLY; MySQL EXCHANGE PARTITION. Use for "should we partition this 2TB table", "drop old data without a giant DELETE", "set up pg_partman", "partition pruning isn't happening". Not for initial modelling (schema-design), expand/contract mechanics (db-migration), one slow query (sql-performance).

greenblacked Updated
The twenty-nine plugins: coding, family, gamedev, operations, delivery, security, manager, personal, career, design, llm, data, techdocs, assurance, client-apps

File contents

greenblacked/AI commit ccf9244fc2

Frequently asked questions

npx get-skill add greenblacked/table-partitioning