If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > help - error creating index

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-25-04, 10:29
ronenshi ronenshi is offline
Registered User
 
Join Date: Sep 2004
Posts: 33
help - error creating index

hi,
Im migratin an oracle db to mysql and when i try to create index i get an error , please if some one know a way to increase the size of the index size??
10x
Ronen

My script is
CREATE TABLE MSM_ALL_EVENTS
(
EVENTID VARCHAR(255) NOT NULL,
SRC_OID VARCHAR(255),
DEST_OID VARCHAR(255),
GENERATION_DATE DATE,
TYPE VARCHAR(50),
DESCR TEXT,
PARENT_EVENTID VARCHAR(255),
GENERATION_NUM DECIMAL(15,5),
ALARM_TYPE VARCHAR(255),
ALARM_DESCR VARCHAR(255),
SEVERITY VARCHAR(50),
IS_RAISED TINYINT,
IS_CONFIRMED TINYINT,
SRC_INTERNAL_OID VARCHAR(255),
CONFIRMATION_NOTE TEXT
) ENGINE = INNODB;

CREATE INDEX IDX_EVENT_CLEAR ON MSM_ALL_EVENTS
(SRC_OID ASC,
TYPE ASC,
ALARM_TYPE ASC,
IS_RAISED ASC,
SRC_INTERNAL_OID ASC);

ERROR 1071 (42000): Specified key was too long; max key length is 1024 bytes
Reply With Quote
  #2 (permalink)  
Old 11-26-04, 06:12
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
I read the error message saying the combined length of the columns comprising the index is to big ie the sum of the columns size exceeds 1024 characters which MySQL / INNODb can't handle
The resolution is to look at the table defintion and work out if you really need to have columns that size

Firt off I'd check the size and types of the columns in the Oracle and ensure you have got the closest match in MySQL, where there are discrepancies size up.

I'm surprised you need so many varchar columns, especially those defined as ID or OID - suspect these should in reality be type Integer
The other odd thing is there is no primary key defined - unusual in an SQL table definition, but not unkown
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On