InnoDB foreign keys and MySQL partitioning

Viewed 69

I am usign MySQL Server version: 5.7.32-0ubuntu0.16.04.1 (Ubuntu). In my DB i have this table with million records:

CREATE TABLE `tableA` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `timestamp` timestamp NULL DEFAULT NULL,
  `value` int(11) NOT NULL,
  `tableB_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_sjfet8dx50bhix3ub1dwocpcx` (`timestamp`,`tableB_id`),
  KEY `FK_su2f3awnwvdpq1h3x5x0drjaw` (`tableB_id`),
  CONSTRAINT `FK_su2f3awnwvdpq1h3x5x0drjaw` FOREIGN KEY (`tableB_id`) REFERENCES `tableB` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

Is it possible using PARTITIONING by RANGE (in this case by YEAR)?

Is it possible to partition even if a foreign key is present?

Thanks!

1 Answers
Related