List:General Discussion« Previous MessageNext Message »
From:Steve Meyers Date:October 21 2001 7:41am
Subject:RE: Length limit of 500 on primary keys?
View as plain text  
The problem is that he has it as a primary key, so he wants it to be unique as well as
indexed.  The best solution (and MUCH MUCH MUCH more efficient) would be to hash each of
the four columns, and create a primary key on that.  Integer keys are much faster and
memory-efficient than string keys.
 
Steve Meyers


> -----Original Message-----
> From: Chris Bolt [mailto:chris.lists@stripped]
> Sent: Saturday, October 20, 2001 8:31 PM
> To: mysql@stripped
> Subject: RE: Length limit of 500 on primary keys?
> 
> 
> > Is there a way to raise this limit? We have some tables with 
> columns that
> > are VARCHAR(200), and need to make a primary key based on 
> combinations of
> > these columns (in some cases, upto 4 columns), and MySQL 
> complains for all
> > of these table definitions that "Specified key was too long. Max key
> > length is 500".
> 
> Why do you need to index the entire column? You can just index a prefix of
> the column, like the first 125 bytes of each column.
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <mysql-thread88548@stripped>
> To unsubscribe, e-mail 
> <mysql-unsubscribe-steve-mysql-mainlist=spamaphobia.com@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 


Thread
Length limit of 500 on primary keys?Shankar Unni21 Oct
  • RE: Length limit of 500 on primary keys?Chris Bolt21 Oct
    • RE: Length limit of 500 on primary keys?Steve Meyers21 Oct
      • Re: Length limit of 500 on primary keys?Shankar Unni22 Oct
        • RE: Length limit of 500 on primary keys?Steve Meyers22 Oct
          • Re: Length limit of 500 on primary keys?Jeremy Zawodny23 Oct
            • RE: Length limit of 500 on primary keys?Steve Meyers23 Oct
              • RE: Length limit of 500 on primary keys?Steve Meyers23 Oct
                • Re: Length limit of 500 on primary keys?Shankar Unni24 Oct
              • Re: Length limit of 500 on primary keys?Bill Adams23 Oct
                • RE: Length limit of 500 on primary keys?Steve Meyers23 Oct
              • RE: Length limit of 500 on primary keys?Don Read23 Oct
            • Re: Length limit of 500 on primary keys?Dan Nelson24 Oct
Re: Length limit of 500 on primary keys?Heikki Tuuri23 Oct