Should I record ID numbers in a table where I record who look whom profile page This is how I have designed:

visitorID
visitedprofileID
datetime


Is it a good idea to add an ID (primary key) to the table, I mean recordID (primary key).

(MySQL with PHP)
I think your two choices here are:


make the (visitorID,visitedprofileID) combination a primary key
add a recordID as primary key


If the table is InnoDB (or it will be in the future for Foreign Key usage), I would go with the second option. Given the way InnoDB handles indexing by adding the primary key to secondary indexes for lookup, if you ever wanted to add an index on datetime, the single field would result in a smaller index.