I have a settings
table.
SETTINGS
--------
settingId int
settingName varchar(20)
Each user can choose to apply the settings, or not. The interface allows them to quickly toggle the settings on or off. The setting is by default off.
I'm looking for best practice on the USER_SETTINGS
table.
Should it be designed such that only active settings are included in the USER_SETTINGS
table? This would involve a lot of inserts and deletes on the table.
USER_SETTINGS (only active settings)
------------------------------------
settingId int
userId int
Or, should it be designed with an active flag? This would involve a single insert for each setting, followed by several updates.
USER_SETTINGS (settings enforced by a flag)
-------------------------------------------
settingId int
userId int
active bit
Setting history is not really important to me, so I wouldn't need to see if the active flag was ever used.
Is it best to use a smaller table and insert, delete, insert, delete, etc., or is it best to add that extra bit, and insert, update, update, update?
I'm running SQL Server 2005.