Looking for some expert views on this guys - I'm not a DBA by trade so would appreciate any advice. Comments on the rest of the schema aren't required as it is purely fabricated to illustrate my question.
Basically I'm working on a new feature for an existing system and am powerless to change the existing schema. So let's say that there currently is a Users table which has a primary key UserID that is of type uniqueidentifier. I want to create a new table called Alerts - related to the Users table in a one-to-many relationship (one User can have many Alerts). Alerts will be regularly queried by this foreign key. I will expect to index this field for performance.
My question is - from what I understand about Indexing strategies, indexing a uniqueidentifier column is (delicately put) not a good idea - so would it be a better idea to have an intermediary table to map these uniqueidentifier keys into a better indexing candidate like an integer?
Users
- UserID uniqueidentifier {PK}
- Username varchar(50)
Alerts
- AlertID int {PK}
- UserID uniqueidentifier {FK}
- Message varchar(250)
- Timestamp datetime
OR
Users
- UserID uniqueidentifier {PK}
- Username varchar(50)
UserMap
- UserKey int identity(1,1) {PK}
- UserID uniqueidentifier {FK}
Alerts
- AlertID int identity(1,1) {PK}
- UserKey int {FK}
- Message varchar(250)
- Timestamp datetime