Backend & systems·Data modelling and storage engines
you split the giant table into monthly chunks so the query touches one of them and dropping old data is a DDL statement instead of a delete.
Partitioning
Also calledtable partitioning, horizontal partitioning
Splitting one logical table into physical pieces by a key, usually range or hash, inside a single database. The wins are partition pruning at query time and cheap bulk deletion by dropping a partition. It only helps queries that filter on the partition key; everything else now scans every partition.