Unix Technical Forum

Horizontal partition incompatible with table definition

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 ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-06-2008, 06:22 PM
avilella
 
Posts: n/a
Default Horizontal partition incompatible with table definition

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"?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:42 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com