如何为以下架构创建分区?

时间:2019-04-05 09:00:11

标签: mysql

我有一张每年有5000行的表。我想做一些动态分区以提高性能。

*  LWORK   (input) INTEGER
*          The dimension of the array WORK.
*          If N <= 1,               LWORK must be at least 1.
*          If JOBZ = 'N' and N > 1, LWORK must be at least 2*N+1.
*          If JOBZ = 'V' and N > 1, LWORK must be at least
*                                                1 + 6*N + 2*N**2.

我希望基于CREATE TABLE `bills` ( `id` int(11) NOT NULL AUTO_INCREMENT, `supplier_id` int(11) NOT NULL, `purchaser_id` int(11) NOT NULL, `bill_number` varchar(255) NOT NULL, `bill_date` date NOT NULL, `due_date` date NOT NULL, `bill_amount` decimal(10,2) NOT NULL, `financial_year` varchar(10) NOT NULL, `is_paid` tinyint(1) DEFAULT '0', `paid_on` date DEFAULT NULL, `ledger_type` int(11) NOT NULL DEFAULT '1', `created_on` datetime DEFAULT NULL, `created_by` int(11) DEFAULT NULL, `modified_on` datetime DEFAULT NULL, `modified_by` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `ledger_type` (`ledger_type`), KEY `created_by` (`created_by`), KEY `modified_by` (`modified_by`), KEY `supplier_id` (`supplier_id`), KEY `purchaser_id` (`purchaser_id`), CONSTRAINT `bills_ibfk_1` FOREIGN KEY (`ledger_type`) REFERENCES `ledger_types` (`id`), CONSTRAINT `bills_ibfk_2` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`), CONSTRAINT `bills_ibfk_3` FOREIGN KEY (`modified_by`) REFERENCES `users` (`id`), CONSTRAINT `bills_ibfk_4` FOREIGN KEY (`supplier_id`) REFERENCES `companies` (`id`), CONSTRAINT `bills_ibfk_5` FOREIGN KEY (`purchaser_id`) REFERENCES `companies` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=810 DEFAULT CHARSET=utf8; supplier_idpurchaser_id列的分区。或其他更好的方法。

0 个答案:

没有答案