tags:

views:

27

answers:

2

Im bulding a site that pulls links from twitter and counts the results from it. Ive been thinking about using the actual URL as the PRIMARY KEY instead of using an auto_increment integer. The url's being pulled will be unique and related to trend tracking. Is this a bad idea and should i stick with an integer?

+1  A: 

As long as you can guarantee that they are unique you can definitely use the URL as the key.

controlfreak123
thanks for that
Baadier
Indexes won't help much for `LIKE` if the search clause starts with a wild card. (most use cases)
recursive
@recursive good point.
controlfreak123
Having a seperate fulltext index on the url is not uncommon for lookups.
Wrikken
A: 

Using URLs would not be an issue as controlfreak123 said. But if there is an performance vertical then you should stick to auto_increment int PK. cause comparision of EQUAL and like is different. Datatype and its processing differs.

J Sinh