Hi guys,
Simple question, so i'll try to keep it short.
2 tables as follows :
----------------------------------------------
USERS (user_id, ip_address, user_agent)
Primary Key (user_id)
VISITS (visit_id, user_id, page, time)
Primary Key (visit_id)
Foreign Key (user_id) references USERS.user_id
----------------------------------------------
Ok, firstly : Is there anything obviously wrong with this that could have an impact on performance?
Finally : I've got VISITS.visit_id as a primary key. Would it be better to have the primary key as both VISITS.visit_id and VISITS.user_id?
Many thanks
NOTE : For a little background, USERS records the users who visit a website, and VISITS records what page on the site they visit, and at what time.