Skip to Content
MySQL 8 Cookbook
book

MySQL 8 Cookbook

by Karthik Appigatla
January 2018
Intermediate to advanced
446 pages
12h 57m
English
Packt Publishing
Content preview from MySQL 8 Cookbook

How it works...

We introduce a column called soft_delete which will be set by trigger. The soft_delete column will be part of range column partitioning.

Partitioning will be like (soft_delete, expires). The soft_delete and expires together controls which partition a row should go. soft_delete column decides the retention of the row. If the expires is 0, the trigger sets the soft_delete value to 0 which puts the row in a no_retention partition and if the value of expires is out of partition bounds, trigger sets the soft_delete value to 1 and the row will be put into a long_retention partition. If the value of expires is with in the partition bounds, trigger sets the soft_delete value to 2. Depending on the value of the expires, the row will ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

MySQL Cookbook

MySQL Cookbook

Paul DuBois
Advanced MySQL 8

Advanced MySQL 8

Eric Vanier, Birju Shah, Tejaswi Malepati

Publisher Resources

ISBN: 9781788395809Other