我有一张每年有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_id
和purchaser_id
列的分区。或其他更好的方法。