Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is BIT field faster than int field in SQL Server?

I have table with some fields that the value will be 1 0. This tables will be extremely large overtime. Is it good to use bit datatype or its better to use different type for performance? Of course all fields should be indexed.

like image 826
THEn Avatar asked Dec 31 '22 00:12

THEn


1 Answers

I can't give you any stats on performance, however, you should always use the type that is best representative of your data. If all you want is 1-0 then absolutely you should use the bit field.

The more information you can give your database the more likely it is to get it's "guesses" right.

like image 126
Robin Day Avatar answered Jan 13 '23 17:01

Robin Day