Wednesday, February 1, 2012

Database Design : Smartly storing many user settings with Boolean values in a single value - Part 2

If you have visited a previous post, where I have demonstrated how you can use bit masks to reduce your settings table.

Update:
There are situations where this solution will NOT do well. Example are cases where you are having many settings OR expecting more settings in future. After some point, your calculated integer or big integer will become very huge and may cause out of limit. so be careful while deciding to use this solution.

ALSO, in place of integers, you can use bitbinary datatype with appropriate length and use appropriate bitwise operators in sql server. That will surely gain more performance.

Thanks to Yougeshwar Patel, Team Lead, Silver touch technologies for bring this to my notice.

No comments:

Post a Comment

Please add your valuable comments about this post if it helped you. Thanks

Popular Posts