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!
question from:
https://stackoverflow.com/questions/65888030/innodb-foreign-keys-and-mysql-partitioning 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…