OptionA:
TableA:
- TableA_ID (PK,int)
- ..
TableB:
- TableB_ID (PK,int)
- ..
TableC:
- TableC_ID (PK,int)
- ..
TableD:
- TableA_ID (FK, int)
- TableB_ID (FK, int)
- TableC_ID (FK, int) (Nullable)
Composite Key on (TableA_ID,TableB_ID,TableC_ID)
I am thinking to design TableD as the following (OptionB)
TableD:
- TableA_ID (FK, int)
- TableB_ID (FK, int)
- TableC_ID (varchar(max) ) (Nullable) and remove the composite key. So, TableC_ID column will have something like these: {1,2,3,4,....}
My application will need to use TableD as search a value in TableB_ID and/or TableC_ID column by giving the key for value in TableA_ID.
I am just wondering which option will be better performance.