Bump actions/checkout from 5 to 6 in the github-actions group (#92)
Bumps the github-actions group with 1 update: actions/checkout.
Updates
actions/checkoutfrom 5 to 6
updated-dependencies:
- dependency-name: actions/checkout dependency-version: ‘6’ dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions …
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Partman
This tool partitions and manages MariaDB tables by sequential IDs.
This is primarily a mechanism for dropping large numbers of rows of data without using
DELETEstatements.Adding partitions in the first place with InnoDB requires a full table copy. Otherwise, the
REORGANIZE PARTITIONcommand is fast only if operating on a partition that is empty, e.g., has no rows.Similar tools:
Usage
Running
partmanin your development environmentConfiguration
You can use a yaml configuration file with the
--configparameter of the form:The
earliest_utc_timestamp_queryentries are optional SQL queries that are run during partition map analysis to determine the eact timestamp of the earliest entry in each partition. If you configure such a query for a table, it must return a single row and column, specifically the epoch timestamp in UTC of the earliest entry the partition. There is expcected a single?entry which will be replaced with the partition value of that partition.For tables which are either partitioned but not yet using this tool’s schema, or which have no empty partitions, the
migratecommand can be useful for proposing alterations to run manually. Note thatmigrateproposes commands that are likely to require partial copies of each table, so likely they will require a maintenance period.Getting started
Configuring
partmanstats, determine an initial partition layoutmigrate, or operate in the normalmaintainmode.How does
partmandetermine when an additional partition is needed?The core algorithm is implemented in a method
get_pending_sql_reorganize_partition_commandsintable_append_partition.py. That algorithm is:For a given table and that table’s intended partition period, desired end-state is to have:
To make it easier to manage, we give all the filled partitions a name to indicate the approximate date that partition began being filled with data. This date is approximate because once a partition contains data, it is no longer an instant
ALTERoperation to rename the partition, rather every contained row gets copied, so this tool predicts the date at which the new partition will become the “active” one.Inputs:
Outputs:
Procedure:
Using the current values, split the partition list into two sub-lists: empty partitions, and non-empty partitions.
If there are no empty partitions:
Perform a statistical regression using each non-empty partition to determine each partition’s fill rate.
Using each partition’s fill rate and their age, predict the future partition fill rate.
Create a new list of intended empty partitions.
For each empty partition:
While the number of empty partitions is less than the intended number of trailing partitions to keep:
Return the lists of non-empty partitions, the current empty partitions, and the post-algorithm intended empty partitions.
How do I run
partmaninnoopmode?The results of the algorithm are converted into
ALTERstatements; if the user configured--noopthey’re emitted to console and the logs for each table. If not set to--noop, the application will execute the ALTERs at the database server and emit the results, including execution time as prometheus statistics if so configured.“Migrate” algorithm
The migrate mode is a limited form of the “Maintain” Algorithm, using a temporary state file to determine rates-of-change. The migrate mode also does not limit itself to only affecting empty partitions, it can and will request changes that will prompt row copies, in order to prepare a table for future use of the “Maintain” algorithm.
TODOs
Lots:
DROPstatements, not perform them.