나는 약 6-7lacs 레코드가있는 테이블을 가지고 있으며 시간이지나면서 커질 것입니다.이 테이블에는 약 16-20 열이 있습니다. 이러한 열에는 일대일 관계가 없습니다.SQL 테이블 분할 - 필요합니까?
사용자 데이터 항목은이 테이블에 저장됩니다.
내 테이블을 여러 개의 작은 테이블로 나눌 수도 있습니다. 그렇지 않으면 테이블을 2 개의 절반으로 분할하고 그 중 모든 항목과 피드를 데이터 입력 연산자에 제공하는 최근의 새로운 레코드로 분할하십시오 그들의 입장에서.
짧은 내 질문에 만약 내가 테이블을 분할하면 mysql 실행 시간이 더 빨라지는지, 아니면 두 개의 절반으로 나누면 더 빠를 것인가이다.
어떤 결합 쿼리도 수행하지 않으므로 후자가 더 적합 할 것입니다. 같은 structure.Is와 images_history이 가능
CREATE TABLE `images` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`primary_category_id` int(10) unsigned DEFAULT NULL,
`secondary_category_id` int(10) unsigned DEFAULT NULL,
`front_url` varchar(255) DEFAULT NULL,
`back_url` varchar(255) DEFAULT NULL,
`title` varchar(100) DEFAULT NULL,
`part` varchar(10) DEFAULT NULL,
`photo_id` int(10) unsigned DEFAULT NULL,
`photo_dt_month` varchar(2) DEFAULT NULL,
`photo_dt_day` varchar(2) DEFAULT NULL,
`photo_dt_yr` varchar(4) DEFAULT NULL,
`type` varchar(25) DEFAULT NULL,
`size_width` int(10) unsigned DEFAULT NULL,
`size_height` int(10) unsigned DEFAULT NULL,
`dpi` int(10) unsigned NOT NULL DEFAULT '0',
`dpix` int(10) unsigned DEFAULT NULL,
`dpiy` int(10) unsigned DEFAULT NULL,
`in_stock` varchar(50) DEFAULT NULL,
`outlet` varchar(50) DEFAULT NULL,
`source` varchar(50) DEFAULT NULL,
`keywords` varchar(255) DEFAULT NULL,
`emotional_keywords` varchar(255) DEFAULT NULL,
`mechanical_keywords` varchar(255) DEFAULT NULL,
`description` text,
`notes` text,
`comments` text,
`exported_to_ebay_dt` datetime DEFAULT NULL,
`exported_to_ebay` set('Y','N') NOT NULL DEFAULT 'N',
`updated_worker_id` int(10) unsigned DEFAULT NULL,
`updated_worker_dt` datetime DEFAULT NULL,
`locked_worker_id` int(10) unsigned DEFAULT NULL,
`locked_worker_dt` datetime DEFAULT NULL,
`updated_admin_id` int(10) unsigned DEFAULT NULL,
`updated_admin_dt` datetime DEFAULT NULL,
`added_dt` datetime DEFAULT NULL,
`updated_manager_id` int(10) unsigned DEFAULT NULL,
`updated_manager_dt` datetime DEFAULT NULL,
`manager_review` set('Y','N') NOT NULL DEFAULT 'N',
`paid_status` set('Y','N') NOT NULL DEFAULT 'N',
`exported_to_web_dt` datetime DEFAULT NULL,
`exported_to_web` set('Y','N') DEFAULT 'N',
`prefix` varchar(50) DEFAULT NULL,
`is_premium` set('Y','N') DEFAULT 'N',
`template` varchar(50) DEFAULT 'HIPE_default',
`photographer` varchar(100) DEFAULT NULL,
`copyright` varchar(100) DEFAULT NULL,
`priority` int(4) DEFAULT '1',
`step` set('1','2') DEFAULT '1',
PRIMARY KEY (`id`),
UNIQUE KEY `part` (`part`),
KEY `primary_category_id` (`primary_category_id`),
KEY `updated_worker_id` (`updated_worker_id`),
KEY `updated_worker_dt` (`updated_worker_dt`)
) ENGINE=MyISAM AUTO_INCREMENT=1013687 DEFAULT CHARSET=latin1
이 만들어지는 항목이 내가 다른 테이블로 분할 할 1lac 주위에 말을 말하는 위 내 테이블 structure.After 또는 내가 그들을 분할해야합니다
업데이트 여러 테이블에 쿼리 실행 시간을 줄이기 위해
는 일부 DDL은 설명 추가 할 수 대략 테이블이 어떻게 생겼는지, 분할 된 경우 어떻게 보일까요? –
편집 해 주셔서 감사합니다 ... didn ' 왜 형식화되지 않았는지 모르겠다. –
'6-7lks'이란 무엇입니까 ?? – DisgruntledGoat