Book Image

Mastering MariaDB

By : Federico Razzoli
Book Image

Mastering MariaDB

By: Federico Razzoli

Overview of this book

Table of Contents (19 chapters)
Mastering MariaDB
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Partitioning types and expressions


The partitioning is based on a value that is calculated for each row using a partitioning expression. The partitioning type is a method that is used to assign each row to a particular partition based on the partitioning expression. For example, the RANGE type assigns a range of values to each partition. When a row is inserted, its partitioning expression is calculated. The row will be written into the partition that matches the proper range.

Partitioning expressions

A partitioning expression is a SQL expression that returns a positive integer value or NULL. It is possible to use a temporal column in the partitioned expression as long as an integer value is returned. However, the return value cannot depend on the current timezone, so the TIMESTAMP and YEAR columns are not allowed. Some partitioning types can use expressions that return other data of different data types, such as DATE or CHAR; this will be discussed later.

The partitioning expressions must also...