yahoo/mysql_partition_manager

Name: mysql_partition_manager

Owner: Yahoo Inc.

Description: MySQL Partition Manager

Created: 2015-09-24 23:20:37.0

Updated: 2018-05-01 15:39:21.0

Pushed: 2015-12-16 21:38:30.0

Homepage:

Size: 192

Language: SQLPL

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

MySQL Partition Manager

MySQL Partition Manager is an open source project for managing partitions for MySQL tables. This code helps you automatically create, maintain and purge partitions with minimal configuration.

Installation

Run the attached SQL file into the database of your choice. Please make sure that event scheduling is enabled on the database server.

When you run this file:

This code has been successfully tested on Percona?s flavor of MySQL 5.5 and MySQL 5.6. It should work on previous versions too. We are currently testing it for MySQL 5.7 as well.

Usage Instructions

Choose a table that you?d like to partition.

The pre-requisite to partition a table is:

The following code shows the settings table:

TE TABLE `partition_manager_settings` (
able` varchar(64) NOT NULL COMMENT 'table name',
olumn` varchar(64) NOT NULL COMMENT 'numeric column with time info',
ranularity` int(10) unsigned NOT NULL COMMENT 'granularity of column, i.e. 1=seconds, 60=minutes...',
ncrement` int(10) unsigned NOT NULL COMMENT 'seconds per individual partition',
etain` int(10) unsigned NULL COMMENT 'seconds of data to retain, null for infinite',
uffer` int(10) unsigned NULL COMMENT 'seconds of empty future partitions to create',
IMARY KEY (`table`)
GINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=Dynamic;

Column Name | Definition ———– | ———- table | table_name column | column that you?d like to partition granularity | factoring granularity in seconds (1 denotes seconds, 60 denotes minutes, 3600 denotes hours) increment | Number of seconds per individual partition (86400 denotes 1 day) retain | Seconds worth of data to retain or null for infinite buffer | Seconds worth of empty feature partitions to maintain

Optionally, call schedule_partition_manager to update the partitioning schedule based on the new table. This is taken care of during the next run automatically, hence its optional.

Known Limitations
License

Copyright 2015 Yahoo Inc. Licensed under the terms of Apache License 2.0. Please see the LICENSE file for terms.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.