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
2010-09-20 23:14:17
thanks for that
Baadier
2010-09-20 23:17:07
Indexes won't help much for `LIKE` if the search clause starts with a wild card. (most use cases)
recursive
2010-09-20 23:26:36
@recursive good point.
controlfreak123
2010-09-20 23:29:42
Having a seperate fulltext index on the url is not uncommon for lookups.
Wrikken
2010-09-20 23:44:21
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
2010-09-20 23:29:45