fishnyc22
04-19-2006, 07:33 PM
Hey everyone, I have a question I was hoping you guys can help me out with.
I have a history table that tracks the changes users make to their profile. It is basically a replica structure of my "profile" table with some slight changes. It writes a line for each user change to the profile. (Note: They can have several profiles. )
I have a history table. with the following columns.
(id) | (profID) | (uID) ...|...|...
(id) is Auto-Incremented and is Primary Key(I belive it has to be PK), the next column (profID) is the profile ID, The 3rd col is the user ID.
So if userID 5 changes their profile #2 twelve times over the course of a month, there will be 12 entries for prof(ID) thoughout the table.
This table will be used for analytics only not for user queries.
So I want to INDEX this table based profID right? or would it be uID > profID? Also, do I need to remove the (id) column from the table? If it is Primary Key will it screw up my index? I see it listed in the INDEX section of phpMYAdmin.
I'm new to this kind of stuff (indexing for large DBs).
Thanks for any guidance!
I have a history table that tracks the changes users make to their profile. It is basically a replica structure of my "profile" table with some slight changes. It writes a line for each user change to the profile. (Note: They can have several profiles. )
I have a history table. with the following columns.
(id) | (profID) | (uID) ...|...|...
(id) is Auto-Incremented and is Primary Key(I belive it has to be PK), the next column (profID) is the profile ID, The 3rd col is the user ID.
So if userID 5 changes their profile #2 twelve times over the course of a month, there will be 12 entries for prof(ID) thoughout the table.
This table will be used for analytics only not for user queries.
So I want to INDEX this table based profID right? or would it be uID > profID? Also, do I need to remove the (id) column from the table? If it is Primary Key will it screw up my index? I see it listed in the INDEX section of phpMYAdmin.
I'm new to this kind of stuff (indexing for large DBs).
Thanks for any guidance!