Agent skill · data analytics · jeremylongshore

managing-database-partitions

Process use when you need to work with database partitioning.

Why this skill is useful

Provides specific partitioning strategies and automation scripts for PostgreSQL and MySQL that the AI wouldn't reliably generate on its own.

What it needs

Requires mysql, psql installed locally. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

Database Partition Manager Overview Implement and manage table partitioning for PostgreSQL and MySQL to improve query performance and simplify data lifecycle management on large tables. This skill covers range partitioning (by date or ID), list partitioning (by category or region), hash partitioning (for even distribution), and composite partitioning. Prerequisites PostgreSQL 10+ (declarative partitioning) or MySQL 5.7+ (native partitioning) Database admin credentials with CREATE TABLE and ALTER TABLE permissions psql or mysql CLI for executing partition DDL Table size metrics: SELECT pgsizepretty(pgtotalrelationsize('tablename')) or SELECT datalength FROM informationschema.TABLES Query patterns on the target table (especially WHERE clause columns used for filtering) Maintenance window availability for initial partition migration on existing tables Instructions 1. Identify partitioning candidates by finding tables that exceed 10GB or 100M rows, have time-based query patterns, or require periodic data purging. Query pgstatusertables to find tables with high sequential scan counts on large row sets. 2. Select the partition key based on the most common query filter column. For time-series data, use the timestamp column. For multi-tenant data, use tenantid. The partition key must appear in most WHERE clauses to enable partition pruning. 3. Choose the partitioning strategy: Range: Best for time-series data. Create monthly or daily partitions. Queries filtering by date range scan only relevant partitions. List: Best for categorical data. Create one partition per category, region, or status value. Hash: Best for even distribution when no natural range exists. Distribute rows across N partitions using hash of the partition key. Composite: Combine range + list for multi-dimensional partitioning (e.g., range by date, then list by region). 4. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/managing-database-partitions--c28ab3

View the source on GitHub

Browse the @skills marketplace