List:General Discussion« Previous MessageNext Message »
From:Jeremy Zawodny Date:October 23 2001 7:18am
Subject:Re: Length limit of 500 on primary keys?
View as plain text  
On Mon, Oct 22, 2001 at 11:42:23AM -0600, Steve Meyers wrote:
> 
> If you use a good 64-bit hash, I doubt you'll run into any
> uniqueness problems.  MySQL will support that as a 64-bit BIGINT.
> You especially should not have any problems if you hash each column,
> then do the primary key across the four hashes.
> 
> I'm not sure why there is a limit, but I'm also not sure why anybody
> in their right mind would want a unique index that long :)

In Gemini, I think the limit is 2048 bytes (or so).  It was increased
to handle URLs (among other things).

> At a previous job, we tested a 32-bit hash function by running it
> against hundreds of thousands of unique URL's stored in our
> database.  We found one collision.  A 64-bit hash is billions of
> times better (4 billion, to be exact).

Good to know.  I wonder how many collisions I'd find if I ran it over
every URL listed in the directory www.yahoo.com.

Which 64 bit hash function did you use?  Invent your own, or something
"off the shelf"?

Jeremy
-- 
Jeremy D. Zawodny, <jzawodn@stripped>
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878   Fax: (408) 349-5454   Cell: (408) 685-5936

MySQL 3.23.41-max: up 47 days, processed 1,025,236,716 queries (251/sec. avg)
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