-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to specify MySQL index length?
PostPosted: Mon Dec 26, 2011 6:15 pm 
Newbie

Joined: Mon Dec 26, 2011 5:40 pm
Posts: 1
In MySQL it is possible to specify index length, which may be shorter than the length of the underlying column(s). This is because MyISAM index width is limited to 1000 bytes, and because indexing long strings is in general slow.

How can I express the following DDL using Hibernate annotations?

Code:
CREATE TABLE IF NOT EXISTS `cache_content` (
   `cid` varchar(2000) NOT NULL,
   `content` longblob,
   PRIMARY KEY (`cid`(100))
) ENGINE=MyISAM;


Notice: PRIMARY KEY (`cid`(100)). This specifies that I want to use the first 100 characters of the 2000-long varchar in my index.

Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.