This is a discussion on Horizontal partition incompatible with table definition within the MySQL forums, part of the Database Server Software category; --> Hi, I would like to use the horizontal partitioning of tables with my Mysql 5.1 instance on a big ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I would like to use the horizontal partitioning of tables with my Mysql 5.1 instance on a big table that has about ~100 clear separations by one field. The problem is that the primary_key messes around my idea of partitioning by key "analysis_id". Even if I drop the UNIQUE key (input_id, analysis_id), mysql will tell me that I need to add analysis_job_id to the partition definition. CREATE TABLE analysis_job ( analysis_job_id int(10) NOT NULL auto_increment, prev_analysis_job_id int(10) NOT NULL, #analysis_job which created this from rules analysis_id int(10) NOT NULL, input_id char(255) not null, job_claim char(40) NOT NULL default '', #UUID hive_id int(10) NOT NULL, status enum('READY','BLOCKED','CLAIMED','GET_INPUT','RUN' ,'WRITE_OUTPUT','DONE','FAILED') DEFAULT 'READY' NOT NULL, retry_count int(10) default 0 not NULL, completed datetime NOT NULL, branch_code int(10) default 1 NOT NULL, runtime_msec int(10) default 0 NOT NULL, query_count int(10) default 0 NOT NULL, PRIMARY KEY (analysis_job_id), # UNIQUE KEY input_id_analysis (input_id, analysis_id), INDEX claim_analysis_status (job_claim, analysis_id, status), INDEX analysis_status (analysis_id, status), INDEX hive_id (hive_id) ) ENGINE=InnoDB MAX_ROWS = 100000000 AVG_ROW_LENGTH = 390 PARTITION BY KEY(analysis_id) PARTITIONS 100; ERROR 1503 (HY000) at line 49: A PRIMARY KEY must include all columns in the table's partitioning function Any ideas? Can I do an equivalent "partition by hash" to my "partition by key 100"? |